diff options
author | Brad King <brad.king@kitware.com> | 2020-12-03 13:36:56 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-03 13:37:21 (GMT) |
commit | 6cf88734a5545f44d0bba4017ab4dbeebbe5b76b (patch) | |
tree | 4ef8bd8a26ad06f94c12f5897067ffb546ce43ad | |
parent | 79077df26bba901944bc2fbeed2d43effb58e51c (diff) | |
parent | f7ff0d34f0750387f5c56483ab6ba3fb4825b62d (diff) | |
download | CMake-6cf88734a5545f44d0bba4017ab4dbeebbe5b76b.zip CMake-6cf88734a5545f44d0bba4017ab4dbeebbe5b76b.tar.gz CMake-6cf88734a5545f44d0bba4017ab4dbeebbe5b76b.tar.bz2 |
Merge topic 'llvm-rc-preprocess-as-c' into release-3.19
f7ff0d34f0 llvm-rc: Force C language for the clang gnu frontend
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5564
-rw-r--r-- | Modules/Platform/Windows-Clang.cmake | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake index f90c36a..389d6ab 100644 --- a/Modules/Platform/Windows-Clang.cmake +++ b/Modules/Platform/Windows-Clang.cmake @@ -105,7 +105,7 @@ macro(__windows_compiler_clang_gnu lang) enable_language(RC) endmacro() -macro(__enable_llvm_rc_preprocessing clang_option_prefix) +macro(__enable_llvm_rc_preprocessing clang_option_prefix extra_pp_flags) # Feed the preprocessed rc file to llvm-rc if(CMAKE_RC_COMPILER_INIT MATCHES "llvm-rc" OR CMAKE_RC_COMPILER MATCHES "llvm-rc") if(DEFINED CMAKE_C_COMPILER_ID) @@ -115,7 +115,7 @@ macro(__enable_llvm_rc_preprocessing clang_option_prefix) endif() if(DEFINED CMAKE_RC_PREPROCESSOR) set(CMAKE_DEPFILE_FLAGS_RC "${clang_option_prefix}-MD ${clang_option_prefix}-MF ${clang_option_prefix}<DEPFILE>") - set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> /fo <OBJECT> <OBJECT>.pp") + set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_COMMAND> -E cmake_llvm_rc <SOURCE> <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> ${extra_pp_flags} -E -- <SOURCE> ++ <CMAKE_RC_COMPILER> <DEFINES> -I <SOURCE_DIR> <INCLUDES> /fo <OBJECT> <OBJECT>.pp") if(CMAKE_GENERATOR MATCHES "Ninja") set(CMAKE_NINJA_CMCLDEPS_RC 0) set(CMAKE_NINJA_DEP_TYPE_RC gcc) @@ -165,7 +165,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" ) include(Platform/Windows-MSVC) # Set the clang option forwarding prefix for clang-cl usage in the llvm-rc processing stage - __enable_llvm_rc_preprocessing("-clang:") + __enable_llvm_rc_preprocessing("-clang:" "") macro(__windows_compiler_clang_base lang) set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}") __windows_compiler_msvc(${lang}) @@ -181,7 +181,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" set(CMAKE_BUILD_TYPE_INIT Debug) - __enable_llvm_rc_preprocessing("") + __enable_llvm_rc_preprocessing("" "-x c") macro(__windows_compiler_clang_base lang) __windows_compiler_clang_gnu(${lang}) endmacro() @@ -189,7 +189,7 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC" else() include(Platform/Windows-GNU) - __enable_llvm_rc_preprocessing("") + __enable_llvm_rc_preprocessing("" "-x c") macro(__windows_compiler_clang_base lang) __windows_compiler_gnu(${lang}) endmacro() |