Skip to content
  • David Cole's avatar
    CheckSymbolExists: Use IMMEDIATE flag for configure_file (#11333) · 6b3993b0
    David Cole authored
    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.
    6b3993b0