mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 23:30:35 -06:00
Swift/Ninja: Fix missing OFM in CMP0157 OLD behavior
The CMP0157 old behavior omitted the output-file-map after the Swift build split because we stopped calling `EmitSwiftDependencyInfo` when we could not split the build because we didn't call `WriteObjectBuildStatement`. If we can't split the build, then we still need to include the OFM information to not break incremental builds.
This commit is contained in:
@@ -1142,7 +1142,8 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatements(
|
||||
std::vector<cmSourceFile const*> swiftSources;
|
||||
|
||||
for (cmSourceFile const* sf : objectSources) {
|
||||
if (sf->GetLanguage() == "Swift") {
|
||||
if (this->GetLocalGenerator()->IsSplitSwiftBuild() &&
|
||||
sf->GetLanguage() == "Swift") {
|
||||
swiftSources.push_back(sf);
|
||||
} else {
|
||||
this->WriteObjectBuildStatement(sf, config, fileConfig,
|
||||
|
||||
1
Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
Normal file
1
Tests/RunCMake/Swift/CMP0157-OLD-build-stdout.txt
Normal file
@@ -0,0 +1 @@
|
||||
swiftc .* -output-file-map CMakeFiles/greetings_default.dir//output-file-map.json .*
|
||||
@@ -49,9 +49,17 @@ elseif(RunCMake_GENERATOR STREQUAL Ninja)
|
||||
run_cmake_command(IncrementalSwift-second ${CMAKE_COMMAND} --build ${IncrementalSwift_TEST_BINARY_DIR} -- -d explain)
|
||||
endblock()
|
||||
|
||||
run_cmake(CMP0157-NEW)
|
||||
run_cmake(CMP0157-OLD)
|
||||
run_cmake(CMP0157-WARN)
|
||||
block()
|
||||
set(CMP0157-OLD_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CMP0157-OLD-build)
|
||||
set(CMP0157-OLD_TEST_NO_CLEAN 1)
|
||||
set(CMP0157-OLD_TEST_OUTPUT_MERGE 1)
|
||||
|
||||
run_cmake(CMP0157-NEW)
|
||||
run_cmake(CMP0157-OLD)
|
||||
# -n: dry-run to avoid actually compiling, -v: verbose to capture executed command
|
||||
run_cmake_command(CMP0157-OLD-build ${CMAKE_COMMAND} --build ${CMP0157-OLD_TEST_BINARY_DIR} -- -n -v)
|
||||
run_cmake(CMP0157-WARN)
|
||||
endblock()
|
||||
|
||||
endif()
|
||||
elseif(RunCMake_GENERATOR STREQUAL "Ninja Multi-Config")
|
||||
|
||||
Reference in New Issue
Block a user