diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 9f9d725..7b1c531 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, @@ -2426,9 +2438,12 @@ void cmLocalGenerator::AddISPCDependencies(cmGeneratorTarget* target) return; } - std::vector<std::string> ispcSuffixes = + cmProp ispcHeaderSuffixProp = target->GetProperty("ISPC_HEADER_SUFFIX"); + assert(ispcHeaderSuffixProp != nullptr); + + std::vector<std::string> ispcArchSuffixes = detail::ComputeISPCObjectSuffixes(target); - const bool extra_objects = (ispcSuffixes.size() > 1); + const bool extra_objects = (ispcArchSuffixes.size() > 1); std::vector<std::string> configsList = this->Makefile->GetGeneratorConfigs(cmMakefile::IncludeEmptyConfig); @@ -2451,14 +2466,19 @@ void cmLocalGenerator::AddISPCDependencies(cmGeneratorTarget* target) const std::string& lang = sf->GetLanguage(); if (lang == "ISPC") { std::string const& objectName = target->GetObjectName(sf); + + // Drop both ".obj" and the source file extension std::string ispcSource = cmSystemTools::GetFilenameWithoutLastExtension(objectName); + ispcSource = + cmSystemTools::GetFilenameWithoutLastExtension(ispcSource); - auto headerPath = cmStrCat(headerDir, '/', ispcSource, ".h"); + auto headerPath = + cmStrCat(headerDir, '/', ispcSource, *ispcHeaderSuffixProp); target->AddISPCGeneratedHeader(headerPath, config); if (extra_objects) { std::vector<std::string> objs = detail::ComputeISPCExtraObjects( - objectName, rootObjectDir, ispcSuffixes); + objectName, rootObjectDir, ispcArchSuffixes); target->AddISPCGeneratedObject(std::move(objs), config); } } |