diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2014-07-01 14:14:27 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-01 14:14:28 (GMT) |
commit | ac8879ce91a61703c9c3fc1e06316dbe8d5a8786 (patch) | |
tree | 9a0029af5657c8df2163082be8ad9102f1401199 /Source/cmNinjaNormalTargetGenerator.cxx | |
parent | 623123aaa0dce491c3d2a365912ef8c443c8d553 (diff) | |
download | CMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.zip CMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.tar.gz CMake-ac8879ce91a61703c9c3fc1e06316dbe8d5a8786.tar.bz2 |
Ninja: Add order-only dependencies to link commands (#14728)
A library or executable target that consists only of a reference to an
object library may have no sources to compile or custom commands to run.
The command in the target is the link (or archive) command. Add missing
order-only dependencies to link commands so that target ordering
dependencies are satisfied for it without depending on an intermediate
compilation rule.
Extend the ObjectLibrary test to cover this case.
Co-Author: Brad King <brad.king@kitware.com>
Diffstat (limited to 'Source/cmNinjaNormalTargetGenerator.cxx')
-rw-r--r-- | Source/cmNinjaNormalTargetGenerator.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx index cfcf9f4..15a1b32 100644 --- a/Source/cmNinjaNormalTargetGenerator.cxx +++ b/Source/cmNinjaNormalTargetGenerator.cxx @@ -608,6 +608,11 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() std::string(cmake::GetCMakeFilesDirectoryPostSlash()) + target.GetName() + ".rsp"; + // Gather order-only dependencies. + cmNinjaDeps orderOnlyDeps; + this->GetLocalGenerator()->AppendTargetDepends(this->GetTarget(), + orderOnlyDeps); + // Write the build statement for this target. globalGen.WriteBuild(this->GetBuildFileStream(), comment.str(), @@ -615,7 +620,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement() outputs, explicitDeps, implicitDeps, - emptyDeps, + orderOnlyDeps, vars, rspfile, commandLineLengthLimit); |