summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKWSys Upstream <kwrobot@kitware.com>2021-05-05 13:19:02 (GMT)
committerBrad King <brad.king@kitware.com>2021-05-05 14:17:30 (GMT)
commit04c6e736f65306f434d99e2f4d6c365a9cc5201b (patch)
treea228ae2732c92208aa9dc64020797e159b336db7
parent18513fa1185f3f2b28f3c4de5ae3f69c9ec9e5cb (diff)
downloadCMake-04c6e736f65306f434d99e2f4d6c365a9cc5201b.zip
CMake-04c6e736f65306f434d99e2f4d6c365a9cc5201b.tar.gz
CMake-04c6e736f65306f434d99e2f4d6c365a9cc5201b.tar.bz2
KWSys 2021-05-05 (e9ca4104)
Code extracted from: https://gitlab.kitware.com/utils/kwsys.git at commit e9ca4104e816c28e3fcf94ce69fd75ca9498f4a7 (master). Upstream Shortlog ----------------- Ben Boeckel (1): 99ffa991 cmake: clear some configure checks when the deployment target changes Martin Willers (2): bbf6cdef Terminal: Simplify CLICOLOR_FORCE check f308fcfb Terminal: Disable color output when CLICOLOR is set to 0
-rw-r--r--CMakeLists.txt10
-rw-r--r--Terminal.c11
2 files changed, 19 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bf8543e..ef615b3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -98,6 +98,16 @@ foreach(p
endif()
endforeach()
+# Some configure checks depend upon the deployment target. Clear checks when
+# the deployment target changes.
+if (APPLE)
+ if (NOT CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL KWSYS_LAST_OSX_DEPLOYMENT_TARGET)
+ unset(KWSYS_CXX_HAS_UTIMENSAT CACHE)
+ endif ()
+ set(KWSYS_LAST_OSX_DEPLOYMENT_TARGET "${CMAKE_OSX_DEPLOYMENT_TARGET}"
+ CACHE INTERNAL "remember the last deployment target to trigger configure rechecks")
+endif ()
+
#-----------------------------------------------------------------------------
# If a namespace is not specified, use "kwsys" and enable testing.
# This should be the case only when kwsys is not included inside
diff --git a/Terminal.c b/Terminal.c
index 9409d1b..57a68bf 100644
--- a/Terminal.c
+++ b/Terminal.c
@@ -167,12 +167,19 @@ static int kwsysTerminalStreamIsVT100(FILE* stream, int default_vt100,
/* Force color according to http://bixense.com/clicolors/ convention. */
{
const char* clicolor_force = getenv("CLICOLOR_FORCE");
- if (clicolor_force && *clicolor_force &&
- strcmp(clicolor_force, "0") != 0) {
+ if (clicolor_force && strcmp(clicolor_force, "0") != 0) {
return 1;
}
}
+ /* Disable color according to http://bixense.com/clicolors/ convention. */
+ {
+ const char* clicolor = getenv("CLICOLOR");
+ if (clicolor && strcmp(clicolor, "0") == 0) {
+ return 0;
+ }
+ }
+
/* GNU make 4.1+ may tell us that its output is destined for a TTY. */
{
const char* termout = getenv("MAKE_TERMOUT");