llvm-rc: Select preprocessor from active languages

The llvm-rc preprocessor is selected according to the
CMAKE_C_COMPILER_ID / CMAKE_CXX_COMPILER_ID which are only defined when
the C or CXX language is active.
This commit is contained in:
Thomas Bernard
2020-03-25 21:55:41 +01:00
committed by Brad King
parent e3185e3d1b
commit 4cc876540e

View File

@@ -135,9 +135,9 @@ if("x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC"
# Feed the preprocessed rc file to llvm-rc
if(CMAKE_RC_COMPILER_INIT STREQUAL "llvm-rc")
if(DEFINED CMAKE_C_COMPILER)
if(DEFINED CMAKE_C_COMPILER_ID)
set(CMAKE_RC_PREPROCESSOR CMAKE_C_COMPILER)
elseif(DEFINED CMAKE_CXX_COMPILER)
elseif(DEFINED CMAKE_CXX_COMPILER_ID)
set(CMAKE_RC_PREPROCESSOR CMAKE_CXX_COMPILER)
endif()
if(DEFINED CMAKE_RC_PREPROCESSOR)