diff options
author | Evan Wilde <etceterawilde@gmail.com> | 2023-12-21 18:26:38 (GMT) |
---|---|---|
committer | Evan Wilde <etceterawilde@gmail.com> | 2024-01-08 17:11:27 (GMT) |
commit | a6a5c433005be3cceab05f088dbd8fe8ffce3540 (patch) | |
tree | f5f5fd37a2bb8deedff63b4864c5de45b4cfa01d /Source | |
parent | 1f66051983ef0bdefa5de139fa9013830a4c3047 (diff) | |
download | CMake-a6a5c433005be3cceab05f088dbd8fe8ffce3540.zip CMake-a6a5c433005be3cceab05f088dbd8fe8ffce3540.tar.gz CMake-a6a5c433005be3cceab05f088dbd8fe8ffce3540.tar.bz2 |
Swift/Ninja: Add support for response files
Adding support for `CMAKE_NINJA_FORCE_RESPONSE_FILE` with Swift.
Issue: #25490
Fixes: #25563
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 4 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 99ea009..d365ef6 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -453,7 +453,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, vars.Language = lang.c_str(); vars.AIXExports = "$AIX_EXPORTS"; - if (this->TargetLinkLanguage(config) == "Swift") { + if (!this->GetLocalGenerator()->IsSplitSwiftBuild() && + this->TargetLinkLanguage(config) == "Swift") { vars.SwiftLibraryName = "$SWIFT_LIBRARY_NAME"; vars.SwiftModule = "$SWIFT_MODULE"; vars.SwiftModuleName = "$SWIFT_MODULE_NAME"; @@ -508,7 +509,8 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile, vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES"; } - if (this->TargetLinkLanguage(config) == "Swift") { + if (!this->GetLocalGenerator()->IsSplitSwiftBuild() && + this->TargetLinkLanguage(config) == "Swift") { vars.SwiftSources = responseFlag.c_str(); } else { vars.Objects = responseFlag.c_str(); diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index bc75a95..7b08865 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -2017,6 +2017,7 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement( std::string const targetObjectFilename = this->ConvertToNinjaPath(cmStrCat( objectDir, '/', moduleName, this->GetGlobalGenerator()->GetLanguageOutputExtension(language))); + objBuild.RspFile = cmStrCat(targetObjectFilename, ".swift.rsp"); if (isSingleOutput) { this->LocalGenerator->AppendFlags(vars["FLAGS"], @@ -2076,7 +2077,8 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement( // Write object build this->GetGlobalGenerator()->WriteBuild(this->GetImplFileStream(fileConfig), - objBuild); + objBuild, + this->ForceResponseFile() ? -1 : 0); } void cmNinjaTargetGenerator::WriteTargetDependInfo(std::string const& lang, |