Ninja Multi-Config: Don't build target dependencies for custom commands
If cross-config mode is used, and a target depends on another target as well as a custom command, we don't want the custom command to also depend on the depended target, as that would build targets unnecessarily. Fix this behavior.
This commit is contained in:
parent
d1cb554c99
commit
081c4679f7
@ -1178,7 +1178,8 @@ void cmGlobalNinjaGenerator::AppendTargetDependsClosure(
|
||||
cmNinjaOuts this_outs; // this will be the new cache entry
|
||||
|
||||
for (auto const& dep_target : this->GetTargetDirectDepends(target)) {
|
||||
if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
|
||||
if (dep_target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
|
||||
(this->EnableCrossConfigBuild() && !dep_target.IsCross())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -23,12 +23,11 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
|
||||
|
||||
${TARGET_OBJECT_FILES_generatorobj_Release}
|
||||
|
||||
${TARGET_OBJECT_FILES_emptyobj_Release}
|
||||
|
||||
EXCLUDE
|
||||
${TARGET_OBJECT_FILES_generator_Debug}
|
||||
|
||||
${TARGET_OBJECT_FILES_generated_Release}
|
||||
${TARGET_OBJECT_FILES_emptyobj_Release}
|
||||
|
||||
${TARGET_OBJECT_FILES_generator_MinSizeRel}
|
||||
${TARGET_OBJECT_FILES_generated_MinSizeRel}
|
||||
|
@ -11,8 +11,6 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
|
||||
|
||||
${TARGET_OBJECT_FILES_generatorobj_Release}
|
||||
|
||||
${TARGET_OBJECT_FILES_emptyobj_Release}
|
||||
|
||||
EXCLUDE
|
||||
${TARGET_OBJECT_FILES_generator_Debug}
|
||||
${TARGET_OBJECT_FILES_generated_Debug}
|
||||
@ -21,6 +19,7 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
|
||||
${TARGET_OBJECT_FILES_emptyobj_Debug}
|
||||
|
||||
${TARGET_OBJECT_FILES_generated_Release}
|
||||
${TARGET_OBJECT_FILES_emptyobj_Release}
|
||||
|
||||
${TARGET_OBJECT_FILES_generator_MinSizeRel}
|
||||
${TARGET_OBJECT_FILES_generated_MinSizeRel}
|
||||
|
@ -12,8 +12,6 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
|
||||
|
||||
${TARGET_OBJECT_FILES_generatorobj_Debug}
|
||||
|
||||
${TARGET_OBJECT_FILES_emptyobj_Debug}
|
||||
|
||||
${TARGET_FILE_generator_Release}
|
||||
${TARGET_OBJECT_FILES_generator_Release}
|
||||
|
||||
@ -30,6 +28,7 @@ check_files("${RunCMake_TEST_BINARY_DIR}"
|
||||
|
||||
EXCLUDE
|
||||
${TARGET_OBJECT_FILES_generated_Debug}
|
||||
${TARGET_OBJECT_FILES_emptyobj_Debug}
|
||||
|
||||
${TARGET_OBJECT_FILES_generator_MinSizeRel}
|
||||
${TARGET_OBJECT_FILES_generated_MinSizeRel}
|
||||
|
Loading…
Reference in New Issue
Block a user