summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-02-05 14:08:57 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-02-05 14:10:16 (GMT)
commit94be195a5462f4d15e722333263f9a2eef09458f (patch)
tree2432ae9093b2776d3e928463c42b4c23ee03bfaa /Modules
parent12a72ba71a15e96c2040cee0cae99bbece440215 (diff)
parent1c2d031cbdbf28f99ef36e5db5e4d9de1b97fff9 (diff)
downloadCMake-94be195a5462f4d15e722333263f9a2eef09458f.zip
CMake-94be195a5462f4d15e722333263f9a2eef09458f.tar.gz
CMake-94be195a5462f4d15e722333263f9a2eef09458f.tar.bz2
Merge topic 'llvm-rc-preprocess'
1c2d031cbd Add -E cmake_llvm_rc to preprocess files for llvm-rc Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4219
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-Clang.cmake17
1 files changed, 17 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 5eddd04..7fd5e49 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -133,6 +133,23 @@ 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)
+ # Feed the preprocessed rc file to llvm-rc
+ if(CMAKE_RC_COMPILER_INIT STREQUAL "llvm-rc")
+ if(DEFINED CMAKE_C_COMPILER)
+ set(CMAKE_RC_PREPROCESSOR CMAKE_C_COMPILER)
+ elseif(DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_RC_PREPROCESSOR CMAKE_CXX_COMPILER)
+ endif()
+ if(DEFINED CMAKE_RC_PREPROCESSOR)
+ set(CMAKE_RC_COMPILE_OBJECT "${CMAKE_COMMAND} -E cmake_llvm_rc <OBJECT>.pp <${CMAKE_RC_PREPROCESSOR}> <DEFINES> -DRC_INVOKED <INCLUDES> <FLAGS> -clang:-MD -clang:-MF -clang:<SOURCE>.d -E <SOURCE> -- <CMAKE_RC_COMPILER> <FLAGS> /fo <OBJECT> <OBJECT>.pp")
+ if(CMAKE_GENERATOR STREQUAL "Ninja")
+ set(CMAKE_NINJA_CMCLDEPS_RC 0)
+ set(CMAKE_NINJA_DEP_TYPE_RC gcc)
+ endif()
+ unset(CMAKE_RC_PREPROCESSOR)
+ endif()
+ endif()
+
macro(__windows_compiler_clang lang)
set(_COMPILE_${lang} "${_COMPILE_${lang}_MSVC}")
__windows_compiler_msvc(${lang})