Merge topic 'ninja-link-order-only-dependencies'
ac8879ce
Ninja: Add order-only dependencies to link commands (#14728)
This commit is contained in:
commit
e2a12b8a58
|
@ -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);
|
||||
|
|
|
@ -59,4 +59,10 @@ add_executable(UseABinternal ${dummy}
|
|||
$<TARGET_OBJECTS:ABmain> $<TARGET_OBJECTS:A> $<TARGET_OBJECTS:B>
|
||||
)
|
||||
|
||||
# Test target-level dependencies of executable without sources.
|
||||
file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/UseABinternalDep.cmake)
|
||||
add_custom_target(UseABinternalDep COMMAND ${CMAKE_COMMAND} -E touch UseABinternalDep.cmake)
|
||||
add_custom_command(TARGET UseABinternal POST_BUILD COMMAND ${CMAKE_COMMAND} -P UseABinternalDep.cmake)
|
||||
add_dependencies(UseABinternal UseABinternalDep)
|
||||
|
||||
add_subdirectory(ExportLanguages)
|
||||
|
|
Loading…
Reference in New Issue