Commit fcafd30a authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'ninja-multi-custom-target-post-build'


 Ninja Multi-Config: Correctly generate POST_BUILD custom targets
Acked-by: Kitware Robot's avatarKitware Robot <>
Merge-request: !6040
parents eeb771e4 f8e2a747
......@@ -173,7 +173,7 @@ void cmNinjaUtilityTargetGenerator::WriteUtilBuildStatements(
std::string ccConfig;
if (genTarget->Target->IsPerConfig() &&
genTarget->GetType() != cmStateEnums::GLOBAL_TARGET) {
ccConfig = fileConfig;
ccConfig = config;
if (config == fileConfig ||
gg->GetPerConfigUtilityTargets().count(genTarget->GetName())) {
^\[1/2\] target_post_build
target main build
\[2/2\] Running utility command for target_post_build
target post build$
......@@ -189,3 +189,11 @@ add_custom_target(target_no_cross_byproduct
COMMAND echo $<CONFIG> target_no_cross_byproduct.txt
COMMENT target_post_build
COMMAND ${CMAKE_COMMAND} -E echo "target main build"
add_custom_command(TARGET target_post_build POST_BUILD
COMMAND ${CMAKE_COMMAND} -E echo "target post build"
......@@ -364,6 +364,8 @@ run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug build-Debug.n
run_ninja(CustomCommandOutputGenex clean-debug-graph -t clean)
run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug-in-release-graph target_no_cross_byproduct:Debug)
run_ninja(CustomCommandOutputGenex clean-release-graph -t clean)
# target_post_build
run_ninja(CustomCommandOutputGenex target_post_build-debug target_post_build)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment