Don't force compiler colors by default, add an option for that 33/49533/2
authorLukasz Pawelczyk <l.pawelczyk@samsung.com>
Wed, 14 Oct 2015 11:43:41 +0000 (13:43 +0200)
committerJan Olszak <j.olszak@samsung.com>
Thu, 15 Oct 2015 09:10:20 +0000 (02:10 -0700)
[Feature]       Make it possible to compile without colors.
[Cause]         Compilation can be on a terminal (or non-terminal) that
                does not understand them.
[Solution]      Add a cmake option to force compiler colors, by default
                they are "auto"
[Verification]  cmake -DVASUM_BUILD_FORCE_COMPILER_COLORS=true/false

Change-Id: I60376daa9801e01901af2f9f8d9d3dd5d6c18494

CMakeLists.txt

index 0bd22e5..c0c800c 100644 (file)
@@ -35,7 +35,9 @@ INCLUDE(GNUInstallDirs)
 IF (( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9))
       OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ))
 
-    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
+    IF (VASUM_BUILD_FORCE_COMPILER_COLORS)
+        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always")
+    ENDIF()
 ENDIF()
 
 ## Compiler flags, depending on the build type #################################