diff options
author | Brad King <brad.king@kitware.com> | 2022-09-21 12:18:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-09-21 12:19:05 (GMT) |
commit | a50346c1d0ebf355ba27177817bc4b45259b0810 (patch) | |
tree | dd5fb1d016492173fc1fe95e0a7f7afd0e6a4649 /Source | |
parent | 4930c36252a1bf63a67be2d196da2254f6d2280f (diff) | |
parent | f6ff19cc9d2ce51791f32b7e4fd0ad6d917a00cc (diff) | |
download | CMake-a50346c1d0ebf355ba27177817bc4b45259b0810.zip CMake-a50346c1d0ebf355ba27177817bc4b45259b0810.tar.gz CMake-a50346c1d0ebf355ba27177817bc4b45259b0810.tar.bz2 |
Merge topic 'swift-mix-cxx'
f6ff19cc9d Tests: Add mixed Swift+CXX source test case
399343486f Tests: Add swift compiler version to test check
a9509cec7e Ninja: Fix mixed Swift/CXX library target generation
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !7679
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index 42f0329..bda8a5f 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -1085,10 +1085,12 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( this->GetGeneratorTarget()->GetObjectSources(sources, config); cmLocalGenerator const* LocalGen = this->GetLocalGenerator(); for (const auto& source : sources) { + const std::string sourcePath = source->GetLanguage() == "Swift" + ? this->GetCompiledSourceNinjaPath(source) + : this->GetObjectFilePath(source, config); oss << " " - << LocalGen->ConvertToOutputFormat( - this->GetCompiledSourceNinjaPath(source), - cmOutputConverter::SHELL); + << LocalGen->ConvertToOutputFormat(sourcePath, + cmOutputConverter::SHELL); } return oss.str(); }(); @@ -1106,10 +1108,15 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement( std::vector<cmSourceFile const*> sources; gt->GetObjectSources(sources, config); for (const auto& source : sources) { - linkBuild.Outputs.push_back( - this->ConvertToNinjaPath(this->GetObjectFilePath(source, config))); - linkBuild.ExplicitDeps.emplace_back( - this->GetCompiledSourceNinjaPath(source)); + if (source->GetLanguage() == "Swift") { + linkBuild.Outputs.push_back( + this->ConvertToNinjaPath(this->GetObjectFilePath(source, config))); + linkBuild.ExplicitDeps.emplace_back( + this->GetCompiledSourceNinjaPath(source)); + } else { + linkBuild.ExplicitDeps.emplace_back( + this->GetObjectFilePath(source, config)); + } } linkBuild.Outputs.push_back(vars["SWIFT_MODULE"]); } else { |