diff options
author | Brad King <brad.king@kitware.com> | 2017-11-28 16:22:46 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-11-28 16:23:36 (GMT) |
commit | 6e613ff399166c59e881331027e65c601feab807 (patch) | |
tree | 1ad7238cc30bfbd28f3ed754397d731039ffbd77 /bootstrap | |
parent | 8b5ae1c1d310fc6eb13b2cde5712b4e319f01f3e (diff) | |
download | CMake-6e613ff399166c59e881331027e65c601feab807.zip CMake-6e613ff399166c59e881331027e65c601feab807.tar.gz CMake-6e613ff399166c59e881331027e65c601feab807.tar.bz2 |
bootstrap: Add infrastructure to detect threading flags
In our loop to detect -std flags, add another layer to detect
threading flags.
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 42 |
1 files changed, 24 insertions, 18 deletions
@@ -981,6 +981,8 @@ if [ -z "${CC}" -a -z "${CXX}" ]; then cmake_toolchain_detect fi +thread_flags='' + #----------------------------------------------------------------------------- # Test C compiler cmake_c_compiler= @@ -1014,16 +1016,18 @@ int main(int argc, char* argv[]) } ' > "${TMPFILE}.c" for std in 11 99 90; do - try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`" + std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" C \"${std}\"`" for compiler in ${cmake_c_compilers}; do - for flag in '' $try_flags; do - echo "Checking whether '${compiler} ${cmake_c_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${compiler}" "${cmake_c_flags} ${flag}" \ - "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then - cmake_c_compiler="${compiler}" - cmake_c_flags="${cmake_c_flags} ${flag}" - break 3 - fi + for std_flag in '' $std_flags; do + for thread_flag in '' $thread_flags; do + echo "Checking whether '${compiler} ${cmake_c_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${compiler}" "${cmake_c_flags} ${std_flag} ${thread_flag}" \ + "${TMPFILE}.c" >> cmake_bootstrap.log 2>&1; then + cmake_c_compiler="${compiler}" + cmake_c_flags="${cmake_c_flags} ${std_flag} ${thread_flag}" + break 3 + fi + done done done done @@ -1081,16 +1085,18 @@ int main() } ' > "${TMPFILE}.cxx" for std in 17 14 11; do - try_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`" + std_flags="`cmake_extract_standard_flags \"${cmake_toolchain}\" CXX \"${std}\"`" for compiler in ${cmake_cxx_compilers}; do - for flag in '' $try_flags; do - echo "Checking whether '${compiler} ${cmake_cxx_flags} ${flag}' works." >> cmake_bootstrap.log 2>&1 - if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${flag}" \ - "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then - cmake_cxx_compiler="${compiler}" - cmake_cxx_flags="${cmake_cxx_flags} ${flag} " - break 3 - fi + for std_flag in '' $std_flags; do + for thread_flag in '' $thread_flags; do + echo "Checking whether '${compiler} ${cmake_cxx_flags} ${std_flag} ${thread_flag}' works." >> cmake_bootstrap.log 2>&1 + if cmake_try_run "${compiler}" "${cmake_cxx_flags} ${std_flag} ${thread_flag}" \ + "${TMPFILE}.cxx" >> cmake_bootstrap.log 2>&1; then + cmake_cxx_compiler="${compiler}" + cmake_cxx_flags="${cmake_cxx_flags} ${std_flag} ${thread_flag} " + break 3 + fi + done done done done |