diff options
author | Jeremy Day <jeremy@thebrowser.company> | 2024-04-22 19:25:02 (GMT) |
---|---|---|
committer | Jeremy Day <jeremy@thebrowser.company> | 2024-04-23 17:29:08 (GMT) |
commit | c5ef7fac239d24e72ae09d48c3ab4ae02e57603d (patch) | |
tree | e2aaff9421614c2219d92c93351d1392cfd3aca4 | |
parent | f1b3143ee95303e97f518f4f357f6f09b966170e (diff) | |
download | CMake-c5ef7fac239d24e72ae09d48c3ab4ae02e57603d.zip CMake-c5ef7fac239d24e72ae09d48c3ab4ae02e57603d.tar.gz CMake-c5ef7fac239d24e72ae09d48c3ab4ae02e57603d.tar.bz2 |
Swift/Ninja: Add description to Swift object build steps
By default, Ninja displays the full build command for the object which
is very verbose. Warnings are often lost in the noise, and compile
errors take some searching to find. If a build step fails, Ninja will
still print out the full build command, so there's no loss of useful
information.
Fixes: #25853
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 5 | ||||
-rw-r--r-- | Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index e2642b2..c52a012 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -1992,6 +1992,11 @@ void cmNinjaTargetGenerator::WriteSwiftObjectBuildStatement( std::string const moduleFilepath = this->ConvertToNinjaPath(cmStrCat(moduleDirectory, '/', moduleFilename)); + vars.emplace("description", + cmStrCat("Building Swift Module '", moduleName, "' with ", + sources.size(), + sources.size() == 1 ? " source" : " sources")); + bool const isSingleOutput = [this, compileMode]() -> bool { bool isMultiThread = false; if (cmValue numThreadStr = diff --git a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt index 8e5b97c..ccd8aee 100644 --- a/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt +++ b/Tests/RunCMake/Swift/IncrementalSwift-second-stdout.txt @@ -1,3 +1,3 @@ -.*Building Swift object A.swiftmodule CMakeFiles(/|\\)A.dir(/|\\)a.swift.o(bj)? -.*Building Swift object B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)? +.*Building Swift Module 'A' with 1 source +.*Building Swift Module 'B' with 1 source FAILED: B.swiftmodule CMakeFiles(/|\\)B.dir(/|\\)b.swift.o(bj)? |