diff options
author | Brad King <brad.king@kitware.com> | 2020-12-15 12:38:13 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-12-15 12:38:20 (GMT) |
commit | 3fb889a0e624bfb73c42f33f99f2b6e76b92030b (patch) | |
tree | 34ff96c2cf975b7481d162bc4fb1c8a8ed9b7cb7 /Source | |
parent | 0ed42946a1d92f90c013904352b7e5082ce6c649 (diff) | |
parent | 18ee6d7e32b1ab7f9081f331912541bd913be243 (diff) | |
download | CMake-3fb889a0e624bfb73c42f33f99f2b6e76b92030b.zip CMake-3fb889a0e624bfb73c42f33f99f2b6e76b92030b.tar.gz CMake-3fb889a0e624bfb73c42f33f99f2b6e76b92030b.tar.bz2 |
Merge topic 'support_CMAKE_VFS_OVERLAY_for_rc_compilation'
18ee6d7e32 llvm-rc: Add CMAKE_VFS_OVERLAY to the preprocessing flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5604
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9f9d725..282f785 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1940,9 +1940,11 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, this->AddConfigVariableFlags(flags, cmStrCat("CMAKE_", lang, "_FLAGS"), config); - std::string const& compiler = this->Makefile->GetSafeDefinition( + std::string compiler = this->Makefile->GetSafeDefinition( cmStrCat("CMAKE_", lang, "_COMPILER_ID")); + std::string compilerSimulateId = this->Makefile->GetSafeDefinition( + cmStrCat("CMAKE_", lang, "_SIMULATE_ID")); if (lang == "Swift") { if (cmProp v = target->GetProperty("Swift_LANGUAGE_VERSION")) { if (cmSystemTools::VersionCompare(cmSystemTools::OP_GREATER_EQUAL, @@ -1957,14 +1959,24 @@ void cmLocalGenerator::AddLanguageFlags(std::string& flags, target->AddCUDAToolkitFlags(flags); } else if (lang == "ISPC") { target->AddISPCTargetFlags(flags); + } else if (lang == "RC" && + this->Makefile->GetSafeDefinition("CMAKE_RC_COMPILER") + .find("llvm-rc") != std::string::npos) { + compiler = this->Makefile->GetSafeDefinition("CMAKE_C_COMPILER_ID"); + if (!compiler.empty()) { + compilerSimulateId = + this->Makefile->GetSafeDefinition("CMAKE_C_SIMULATE_ID"); + } else { + compiler = this->Makefile->GetSafeDefinition("CMAKE_CXX_COMPILER_ID"); + compilerSimulateId = + this->Makefile->GetSafeDefinition("CMAKE_CXX_SIMULATE_ID"); + } } + // Add VFS Overlay for Clang compiliers if (compiler == "Clang") { if (cmProp vfsOverlay = this->Makefile->GetDefinition("CMAKE_CLANG_VFS_OVERLAY")) { - std::string const& compilerSimulateId = - this->Makefile->GetSafeDefinition( - cmStrCat("CMAKE_", lang, "_SIMULATE_ID")); if (compilerSimulateId == "MSVC") { this->AppendCompileOptions( flags, |