summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2021-04-22 19:51:53 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2021-04-22 19:51:53 (GMT)
commitf8e2a74712c01f205c794102dd0151feace7a5df (patch)
tree7df14d43e5715647cf60bbfd2f7afafe30f9d800 /Tests
parentb0f203f133ab3f4af1a00ad556de34c9b0db8c91 (diff)
downloadCMake-f8e2a74712c01f205c794102dd0151feace7a5df.zip
CMake-f8e2a74712c01f205c794102dd0151feace7a5df.tar.gz
CMake-f8e2a74712c01f205c794102dd0151feace7a5df.tar.bz2
Ninja Multi-Config: Correctly generate POST_BUILD custom targets
Fixes: #22096
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_post_build-debug-ninja-stdout.txt4
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake8
-rw-r--r--Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake2
3 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_post_build-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_post_build-debug-ninja-stdout.txt
new file mode 100644
index 0000000..6bf0a49
--- /dev/null
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-target_post_build-debug-ninja-stdout.txt
@@ -0,0 +1,4 @@
+^\[1/2\] target_post_build
+target main build
+\[2/2\] Running utility command for target_post_build
+target post build$
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake
index e49cc32..bb68a50 100644
--- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake
@@ -189,3 +189,11 @@ add_custom_target(target_no_cross_byproduct
COMMAND echo $<CONFIG> target_no_cross_byproduct.txt
WORKING_DIRECTORY $<CONFIG>
)
+
+add_custom_target(target_post_build
+ 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"
+ )
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
index 23b4aea..aa42739 100644
--- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
+++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake
@@ -364,6 +364,8 @@ run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug build-Debug.n
run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean)
run_ninja(CustomCommandOutputGenex target_no_cross_byproduct-debug-in-release-graph build-Release.ninja target_no_cross_byproduct:Debug)
run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean)
+# target_post_build
+run_ninja(CustomCommandOutputGenex target_post_build-debug build-Debug.ninja target_post_build)
unset(RunCMake_TEST_NO_CLEAN)
unset(RunCMake_TEST_BINARY_DIR)