diff options
author | Yamakaky <yamakaky@gmail.com> | 2015-08-27 09:56:46 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2015-08-27 22:16:43 -0400 |
commit | 4a8d557d4444122fed9db828013ba1e95e24a154 (patch) | |
tree | c6e98d87b4e3ffb82ee92b9153343862dc3617cf | |
parent | f15b864239e666b87e2c6a9beb0fa3cf6ac97c67 (diff) | |
download | rneovim-4a8d557d4444122fed9db828013ba1e95e24a154.tar.gz rneovim-4a8d557d4444122fed9db828013ba1e95e24a154.tar.bz2 rneovim-4a8d557d4444122fed9db828013ba1e95e24a154.zip |
cmake: Enable -fdiagnostics-color=auto gcc flag. #3137
-rw-r--r-- | CMakeLists.txt | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b5875e599..2b83b56f75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,9 @@ set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix list(INSERT CMAKE_PREFIX_PATH 0 ${DEPS_PREFIX}) set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig") +# used for check_c_compiler_flag +include(CheckCCompilerFlag) + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") # CMake tries to treat /sw and /opt/local as extension of the system path, but # that doesn't really work out very well. Once you have a dependency that @@ -125,7 +128,6 @@ if(MINGW) add_definitions(-D__USE_MINGW_ANSI_STDIO) endif() -include(CheckCCompilerFlag) check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG) check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG) @@ -135,6 +137,11 @@ elseif(HAS_FSTACK_PROTECTOR_FLAG) add_definitions(-fstack-protector --param ssp-buffer-size=4) endif() +check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG) +if(HAS_DIAG_COLOR_FLAG) + add_definitions(-fdiagnostics-color=auto) +endif() + option( TRAVIS_CI_BUILD "Travis CI build. Extra compilation flags will be set." OFF) |