summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-03 11:39:45 (GMT)
committerBrad King <brad.king@kitware.com>2020-06-03 11:48:52 (GMT)
commit2bc89f1a0310ad96b1188dd54081ef7281e54601 (patch)
treee65f49c223c9d27e3450d6142151f1cb8c0ee0f7 /CMakeLists.txt
parentd350d4668aff6f0a077c25109cefe4250ce22a4c (diff)
downloadCMake-2bc89f1a0310ad96b1188dd54081ef7281e54601.zip
CMake-2bc89f1a0310ad96b1188dd54081ef7281e54601.tar.gz
CMake-2bc89f1a0310ad96b1188dd54081ef7281e54601.tar.bz2
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 7658820..07ba2e3 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.