aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2019-01-03 11:14:12 +0100
committerThomas White <taw@physics.org>2019-01-03 11:14:12 +0100
commit039af49621dff40316e3a4a553a82cfb6bf9b96d (patch)
treee378a0278e52351aff55f037c49ae2bf79fce314 /CMakeLists.txt
parentb2286aca7040abff47afe07c12d741bb91441f63 (diff)
Check for -fdiagnostics-color before using it
Needed for old gcc versions
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c6d5084b..22ed1fad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -59,7 +59,11 @@ link_directories(${GTK_LIBRARY_DIRS})
pkg_search_module(CAIRO cairo)
pkg_search_module(GDKPIXBUF gdk-pixbuf-2.0)
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
+include(CheckCCompilerFlag)
+check_c_compiler_flag("-fdiagnostics-color=always" HAVE_DIAG_COLOR)
+if (HAVE_DIAG_COLOR)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fdiagnostics-color=always")
+endif (HAVE_DIAG_COLOR)
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
add_definitions(-DHAVE_CONFIG_H)