summaryrefslogtreecommitdiffstats
path: root/Modules/CheckSymbolExists.cmake
diff options
context:
space:
mode:
authorDavid Cole <david.cole@kitware.com>2011-08-22 19:48:26 (GMT)
committerDavid Cole <david.cole@kitware.com>2011-08-22 19:50:03 (GMT)
commit6b3993b0bfaeb18ea93367006a9512ecc7f159b4 (patch)
treee847fc24974e4916891177dfdcd7f818f52c5626 /Modules/CheckSymbolExists.cmake
parentfd61be71401ef9e0a241562fc31539273084deff (diff)
downloadCMake-6b3993b0bfaeb18ea93367006a9512ecc7f159b4.zip
CMake-6b3993b0bfaeb18ea93367006a9512ecc7f159b4.tar.gz
CMake-6b3993b0bfaeb18ea93367006a9512ecc7f159b4.tar.bz2
CheckSymbolExists: Use IMMEDIATE flag for configure_file (#11333)
The test "complex" sets the variable CMAKE_BACKWARDS_COMPATIBILITY to 1.4. When that variable is set, configure_file does not default to IMMEDIATE mode processing. And so, the output file likely does not exist yet by the time the next line in the CMakeLists.txt file is processed. When that next line is "try_compile" on that file, this is a problem. Fix the problem by explicitly using IMMEDIATE in the configure_file call. This problem was quite mysterious, as it only showed up on the "complex" test, when the previous commit introduced a CheckSymbolExists call into the FindThreads module. Which is not even explicitly included in the "complex" test... FindThreads gets included indirectly only as a side effect of setting CMAKE_BACKWARDS_COMPATIBILITY to 1.4 and even then it's included indirectly by auto-inclusion of CMakeBackwardCompatibilityC.cmake... Wow. Just wow.
Diffstat (limited to 'Modules/CheckSymbolExists.cmake')
-rw-r--r--Modules/CheckSymbolExists.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index be7d658..183b2bb 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -63,7 +63,7 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\nvoid cmakeRequireSymbol(int dummy,...){(void)dummy;}\nint main()\n{\n#ifndef ${SYMBOL}\n cmakeRequireSymbol(0,&${SYMBOL});\n#endif\n return 0;\n}\n")
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
- "${SOURCEFILE}" @ONLY)
+ "${SOURCEFILE}" @ONLY IMMEDIATE)
MESSAGE(STATUS "Looking for ${SYMBOL}")
TRY_COMPILE(${VARIABLE}