Added cross-build check fix in support of https://github.com/Unidata/netcdf-c/issues/753

This commit is contained in:
Ward Fisher 2018-01-02 14:05:52 -07:00
parent 69a418c27d
commit 2281f3e133

View File

@ -93,7 +93,6 @@ INCLUDE(${CMAKE_ROOT}/Modules/CheckTypeSize.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CheckFunctionExists.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CheckCXXSourceCompiles.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckCSourceCompiles.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CheckCSourceCompiles.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckCSourceRuns.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/TestBigEndian.cmake) INCLUDE(${CMAKE_ROOT}/Modules/TestBigEndian.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake) INCLUDE(${CMAKE_ROOT}/Modules/CheckSymbolExists.cmake)
INCLUDE(${CMAKE_ROOT}/Modules/GetPrerequisites.cmake) INCLUDE(${CMAKE_ROOT}/Modules/GetPrerequisites.cmake)
@ -1207,14 +1206,12 @@ MARK_AS_ADVANCED(ENABLE_SHARED_LIBRARY_VERSION)
SET(SIGNED_TEST_SOURCE "\n SET(SIGNED_TEST_SOURCE "\n
#include <stdlib.h>\n #include <stdlib.h>\n
int main(void) {\n int main(void) {\n
char is_signed = (char) - 1;\n char error_if_char_is_signed[((char)-1) < 0 ? -1 : 1];\n
if(is_signed < 0)\n error_if_char_is_signed[0] = 0;
return 1;\n return -;\n
else\n
return 0;\n
}\n") }\n")
CHECK_C_SOURCE_RUNS("${SIGNED_TEST_SOURCE}" __CHAR_UNSIGNED__) CHECK_C_SOURCE_COMPILES("${SIGNED_TEST_SOURCE}" __CHAR_UNSIGNED__)
# Library include checks # Library include checks
CHECK_INCLUDE_FILE("math.h" HAVE_MATH_H) CHECK_INCLUDE_FILE("math.h" HAVE_MATH_H)