summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2019-08-16 19:37:08 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-08-16 19:37:20 (GMT)
commit7a92fb7bf675005b7d77dc6fdb157409dace52f9 (patch)
tree3bf585d623ccb77ce50c5e0594e9efb30e256ea7 /Modules
parent2beed5a4ef66f415f4efa327a8c479395d262e52 (diff)
parentcea253a38bb33beb64c7b36c7c75929453ec8749 (diff)
downloadCMake-7a92fb7bf675005b7d77dc6fdb157409dace52f9.zip
CMake-7a92fb7bf675005b7d77dc6fdb157409dace52f9.tar.gz
CMake-7a92fb7bf675005b7d77dc6fdb157409dace52f9.tar.bz2
Merge topic 'clang-llvm-rc'
cea253a38b Clang: Fall back to llvm-rc when rc is unavailable Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Merge-request: !3687
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-Clang.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index b317da6..728e0b9 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -99,6 +99,21 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
"or clang-cl as both C and C++ compilers.")
endif()
+ if(NOT CMAKE_RC_COMPILER_INIT)
+ # Check if rc is already in the path
+ # This may happen in cases where the user is already in a visual studio environment when CMake is invoked
+ find_program(__RC_COMPILER_PATH NAMES rc)
+
+ # Default to rc if it's available, otherwise fall back to llvm-rc
+ if(__RC_COMPILER_PATH)
+ set(CMAKE_RC_COMPILER_INIT rc)
+ else()
+ set(CMAKE_RC_COMPILER_INIT llvm-rc)
+ endif()
+
+ unset(__RC_COMPILER_PATH CACHE)
+ endif()
+
if ( "x${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" OR "x${CMAKE_C_COMPILER_FRONTEND_VARIANT}" STREQUAL "xMSVC" )
include(Platform/Windows-MSVC)