obs-studio
obs-studio copied to clipboard
cmake/linux: Allow cmake command to disable color diagnostics
Description
Set CACHE
option to set CMAKE_COLOR_DIAGNOSTICS
= ON
so that the variable can be configurable by cmake
command.
Motivation and Context
When using :make
command on Vim, Vim cannot recognize the file name of the reported errors and warnings because of the escape sequences.
For example, after the build flow, Vim opens a file ^[[01m^[[K/home/user/obs-studio/libobs/util/buffered-file-serializer.c
and shows a warning message like below.
(142 of 2641): ^[[m^[[K ^[[01;35m^[[Kwarning: ^[[m^[[K‘^[[01m^[[...e used uninitialized [^[[01;35m^[[K-Wmaybe-uninitialized^[[m^[[K]
How Has This Been Tested?
- Go to
obs-studio
repository. - Configure with cmake
cmake -S . -B build -D CMAKE_COLOR_DIAGNOSTICS=OFF
(and more options). - Open Vim and set
:let &makeprg='cd build && make -j9'
to runmake
inbuild
directory. - Run
:make -B
command on Vim. - Assuming some warnings or errors are reported, check
:cn
and:cp
commands work.
Types of changes
- Tweak (non-breaking change to improve existing functionality)
Checklist:
- [x] My code has been run through clang-format.
- [x] I have read the contributing document.
- [x] My code is not on the master branch.
- [x] The code has been tested.
- [x] All commit messages are properly formatted and commits squashed where appropriate.
- [x] I have included updates to all appropriate documentation.