From 2bc89f1a0310ad96b1188dd54081ef7281e54601 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 3 Jun 2020 07:39:45 -0400 Subject: cmSystemTools: Hard-code try_compile results for Windows All Windows platforms offer `environ` in `stdlib.h` and do not have `unsetenv`. --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'CMakeLists.txt') 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. -- cgit v1.2.1