diff options
author | Hugo Parente Lima <hugo.pl@gmail.com> | 2010-08-19 15:11:36 -0300 |
---|---|---|
committer | Hugo Parente Lima <hugo.pl@gmail.com> | 2012-03-09 19:10:08 -0300 |
commit | 729bb0a501941a7b6bb85995d4e1263567017ec3 (patch) | |
tree | eca3cc419d34c72ba5c78c8013974e4b6d06bc3a | |
parent | de371608299b190ba310923a99ef2619bf632cd3 (diff) |
Colored output is disabled by default on Windows.
Define the NOCOLOR constant to disable it in other systems.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>
Renato Araújo <renato.filho@openbossa.org>
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | reporthandler.cpp | 18 |
2 files changed, 10 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index ebc054ba9..0e8c5c880 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ if (NOT DISABLE_DOCSTRINGS) endif() if(MSVC) - set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DNOCOLOR /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS") + set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS") elseif(CMAKE_HOST_UNIX) option(ENABLE_GCC_OPTIMIZATION "Enable specific GCC flags to optimize library size and performance. Only available on Release Mode" 0) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fvisibility=hidden") diff --git a/reporthandler.cpp b/reporthandler.cpp index 22f7da6b3..471f008ef 100644 --- a/reporthandler.cpp +++ b/reporthandler.cpp @@ -29,16 +29,16 @@ #include <cstdarg> #include <cstdio> -#ifndef NOCOLOR -#define COLOR_END "\033[0m" -#define COLOR_WHITE "\033[1;37m" -#define COLOR_YELLOW "\033[1;33m" -#define COLOR_GREEN "\033[0;32m" +#if _WINDOWS || NOCOLOR + #define COLOR_END "" + #define COLOR_WHITE "" + #define COLOR_YELLOW "" + #define COLOR_GREEN "" #else -#define COLOR_END "" -#define COLOR_WHITE "" -#define COLOR_YELLOW "" -#define COLOR_GREEN "" + #define COLOR_END "\033[0m" + #define COLOR_WHITE "\033[1;37m" + #define COLOR_YELLOW "\033[1;33m" + #define COLOR_GREEN "\033[0;32m" #endif static bool m_silent = false; |