diff options
author | Raul Tambre <raul@tambre.ee> | 2020-03-16 09:45:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-04-07 13:33:09 (GMT) |
commit | 25439c7d62113a29e253c0556f8cb64e6c18c75c (patch) | |
tree | 016137835f034103c2ce8d5f6d10654e1a688439 /bootstrap | |
parent | ec4c25cb928bcbee5d70ee6c791a27c7021973d2 (diff) | |
download | CMake-25439c7d62113a29e253c0556f8cb64e6c18c75c.zip CMake-25439c7d62113a29e253c0556f8cb64e6c18c75c.tar.gz CMake-25439c7d62113a29e253c0556f8cb64e6c18c75c.tar.bz2 |
Clang: Refactor CXX standard flags into __compiler_clang_cxx_standards()
These standard flags are the same for CXX, OBJCXX and CUDA.
Refactor them into a single macro to reduce duplication and so we can easily reuse them.
Updated bootstrap script to search in the general Clang module instead of the language-specific.
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -9,8 +9,16 @@ die() { # Compile flag extraction function. cmake_extract_standard_flags() { - sed -n "s/ *set *( *CMAKE_${2}${3}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \ - "${cmake_source_dir}/Modules/Compiler/"${1:-*}-${2}.cmake 2>/dev/null | tr ';' ' ' + id="${1:-*}" + lang="${2}" + ver="${3}" + sed -n "s/ *set *( *CMAKE_${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \ + "${cmake_source_dir}/Modules/Compiler/"${id}-${lang}.cmake \ + 2>/dev/null | tr ';' ' ' + # Clang's CXX compiler flags are in the common module. + sed -n "s/ *set *( *CMAKE_\\\${lang}${ver}_EXTENSION_COMPILE_OPTION *\"\{0,1\}\([^\")]*\).*/\1/p" \ + "${cmake_source_dir}/Modules/Compiler/Clang.cmake" \ + 2>/dev/null | tr ';' ' ' } # Version number extraction function. |