ENH: Simplify the test
This commit is contained in:
parent
84f1420d82
commit
b507f8f0d1
@ -125,6 +125,10 @@ IF(BUILD_CursesDialog)
|
|||||||
SUBDIRS(Source/CursesDialog/form)
|
SUBDIRS(Source/CursesDialog/form)
|
||||||
ENDIF(BUILD_CursesDialog)
|
ENDIF(BUILD_CursesDialog)
|
||||||
|
|
||||||
|
INCLUDE(CheckSymbolExists)
|
||||||
|
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
|
||||||
|
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
|
||||||
|
|
||||||
SUBDIRS(Source Modules Templates Utilities Tests/CMakeTests)
|
SUBDIRS(Source Modules Templates Utilities Tests/CMakeTests)
|
||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
|
|
||||||
|
@ -23,23 +23,6 @@ INCLUDE_DIRECTORIES(
|
|||||||
|
|
||||||
# let cmake know it is supposed to use it
|
# let cmake know it is supposed to use it
|
||||||
ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
|
ADD_DEFINITIONS(-DCMAKE_BUILD_WITH_CMAKE)
|
||||||
INCLUDE(CheckSymbolExists)
|
|
||||||
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
|
|
||||||
INCLUDE("${CMAKE_SOURCE_DIR}/Modules/CheckCXXSourceCompiles.cmake")
|
|
||||||
CHECK_CXX_SOURCE_COMPILES(
|
|
||||||
"int main(int argc, char* argv[]) { return sizeof(environ); }"
|
|
||||||
HAVE_ENVIRON_WITHOUT_SIGNATURE)
|
|
||||||
IF(NOT HAVE_ENVIRON_WITHOUT_SIGNATURE)
|
|
||||||
CHECK_CXX_SOURCE_COMPILES(
|
|
||||||
"
|
|
||||||
#ifdef _WIN32
|
|
||||||
extern __declspec( dllimport ) char** environ;
|
|
||||||
#else
|
|
||||||
extern char** environ;
|
|
||||||
#endif
|
|
||||||
int main(int argc, char* argv[]) { return sizeof(environ); }"
|
|
||||||
HAVE_ENVIRON_WITH_SIGNATURE)
|
|
||||||
ENDIF(NOT HAVE_ENVIRON_WITHOUT_SIGNATURE)
|
|
||||||
|
|
||||||
OPTION(CMAKE_REGENERATE_YACCLEX
|
OPTION(CMAKE_REGENERATE_YACCLEX
|
||||||
"Regenerate YACC and LEXX files" OFF)
|
"Regenerate YACC and LEXX files" OFF)
|
||||||
|
@ -56,7 +56,7 @@
|
|||||||
# pragma set woff 1375 /* base class destructor not virtual */
|
# pragma set woff 1375 /* base class destructor not virtual */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAVE_ENVIRON_WITHOUT_SIGNATURE)
|
#if !defined(HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
|
||||||
// For GetEnvironmentVariables
|
// For GetEnvironmentVariables
|
||||||
# if defined(_WIN32)
|
# if defined(_WIN32)
|
||||||
extern __declspec( dllimport ) char** environ;
|
extern __declspec( dllimport ) char** environ;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user