summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-03 07:39:45 -0400
committerBrad King <brad.king@kitware.com>2020-06-03 07:48:52 -0400
commit2bc89f1a0310ad96b1188dd54081ef7281e54601 (patch)
treee65f49c223c9d27e3450d6142151f1cb8c0ee0f7 /CMakeLists.txt
parentd350d4668aff6f0a077c25109cefe4250ce22a4c (diff)
downloadcmake-2bc89f1a0310ad96b1188dd54081ef7281e54601.tar.gz
cmSystemTools: Hard-code try_compile results for Windows
All Windows platforms offer `environ` in `stdlib.h` and do not have `unsetenv`.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 9 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7658820ee1..07ba2e30bc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -711,10 +711,15 @@ if(NOT CMake_TEST_EXTERNAL_CMAKE)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
- # no clue why we are testing for this here
- include(CheckSymbolExists)
- CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
- CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ # Checks for cmSystemTools.
+ if(WIN32)
+ set(HAVE_UNSETENV 0)
+ set(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE 1)
+ else()
+ include(CheckSymbolExists)
+ CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
+ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
+ endif()
endif()
# CMAKE_TESTS_CDASH_SERVER: CDash server used by CMake/Tests.