diff options
author | Brad King <brad.king@kitware.com> | 2021-03-30 13:50:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-03-30 13:50:48 (GMT) |
commit | 1df75b171d65ea6679729ab52d1ca2a588a5eef8 (patch) | |
tree | c4cbb7da7c503cace0a945ae88349e8689d40588 /Tests | |
parent | d212d91f14d2f2ed4f77ea7f190bbea2a4f6e302 (diff) | |
parent | 6dd89529e82cbc9650aff204fe063882ae19043b (diff) | |
download | CMake-1df75b171d65ea6679729ab52d1ca2a588a5eef8.zip CMake-1df75b171d65ea6679729ab52d1ca2a588a5eef8.tar.gz CMake-1df75b171d65ea6679729ab52d1ca2a588a5eef8.tar.bz2 |
Merge topic 'nmc-cc-no-output' into release-3.20
6dd89529e8 Ninja Multi-Config: Fix crash on custom command config with no output
e21a80e97d Tests: Teach RunCMake to ignore incidental 'Recompacting log' ninja output
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !5950
Diffstat (limited to 'Tests')
10 files changed, 63 insertions, 2 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..3c92457 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating echo_dbg_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_dbg_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-ninja-stdout.txt new file mode 100644 index 0000000..2ab35a7 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_dbg_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_dbg_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-release-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-release-ninja-stdout.txt new file mode 100644 index 0000000..4b1473d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbg-release-ninja-stdout.txt @@ -0,0 +1,2 @@ +^\[1/2\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/2\] Linking C executable Release[\/]echo(\.exe)?$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-in-release-graph-ninja-stdout.txt new file mode 100644 index 0000000..25c357c --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-in-release-graph-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] Generating echo_dbgx_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Debug' 'echo_dbgx_Debug\.txt' 'echo_dbgx_byproduct_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-ninja-stdout.txt new file mode 100644 index 0000000..153906d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-debug-ninja-stdout.txt @@ -0,0 +1,4 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Debug[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Debug[\/]echo(\.exe)? +\[3/3\] Generating echo_dbgx_Debug\.txt +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Debug[\/]echo(\.exe)?' 'Debug' 'echo_dbgx_Debug\.txt' 'echo_dbgx_byproduct_Debug\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-release-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-release-ninja-stdout.txt new file mode 100644 index 0000000..32aa070 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_dbgx-release-ninja-stdout.txt @@ -0,0 +1,5 @@ +^\[1/3\] Building C object CMakeFiles[\/]echo.dir[\/]Release[\/]echo\.c\.(o|obj) +\[2/3\] Linking C executable Release[\/]echo(\.exe)? +\[3/3\] [^ +]* +'[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build'\$ '[^']*[\/]Tests[\/]RunCMake[\/]NinjaMultiConfig[\/]CustomCommandOutputGenex-build[\/]Release[\/]echo(\.exe)?' 'Release' 'echo_dbgx_byproduct_Release\.txt'$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt index 45f2e57..d90a2f3 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex-echo_target_depend_out-debug-in-release-graph-ninja-stdout.txt @@ -1,5 +1,4 @@ -^(Recompacting log\.\.\. -)?\[1/2\] Generating depend_Debug\.txt +^\[1/2\] Generating depend_Debug\.txt depend_Debug\.txt \[2/2\] echo_target_depend_out echo_target_depend_out_Debug\.txt$ diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake index 5d6f421..e49cc32 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandOutputGenex.cmake @@ -119,6 +119,30 @@ foreach(case add_custom_target(${case} DEPENDS ${case}_$<CONFIG>.txt) endforeach() +# An OUTPUT in only one configuration. +add_custom_command( + OUTPUT "$<$<CONFIG:Debug>:echo_dbg_Debug.txt>" + COMMAND echo $<CONFIG> "$<$<CONFIG:Debug>:echo_dbg_Debug.txt>" + ) +set_property(SOURCE ${CMAKE_CURRENT_BINARY_DIR}/echo_dbg_Debug.txt PROPERTY SYMBOLIC 1) +add_custom_target(echo_dbg DEPENDS "$<$<CONFIG:Debug>:echo_dbg_Debug.txt>") + +# An OUTPUT in only one configuration with BYPRODUCTS in every configuration. +add_custom_command( + OUTPUT "$<$<CONFIG:Debug>:echo_dbgx_Debug.txt>" + BYPRODUCTS echo_dbgx_byproduct_$<CONFIG>.txt + COMMAND echo $<CONFIG> "$<$<CONFIG:Debug>:echo_dbgx_Debug.txt>" echo_dbgx_byproduct_$<CONFIG>.txt + COMMAND_EXPAND_LISTS + ) + set_property(SOURCE + ${CMAKE_CURRENT_BINARY_DIR}/echo_dbgx_Debug.txt + ${CMAKE_CURRENT_BINARY_DIR}/echo_dbgx_byproduct_Debug.txt + ${CMAKE_CURRENT_BINARY_DIR}/echo_dbgx_byproduct_Release.txt + ${CMAKE_CURRENT_BINARY_DIR}/echo_dbgx_byproduct_MinSizeRel.txt + ${CMAKE_CURRENT_BINARY_DIR}/echo_dbgx_byproduct_RelWithDebInfo.txt + PROPERTY SYMBOLIC 1) +add_custom_target(echo_dbgx DEPENDS "$<$<CONFIG:Debug>:echo_dbgx_Debug.txt>") + add_custom_target(echo_target_raw BYPRODUCTS echo_target_raw_$<CONFIG>.txt COMMENT echo_target_raw diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 0d4db52..23b4aea 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -323,6 +323,20 @@ run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug build-Debug. run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) run_ninja(CustomCommandOutputGenex echo_no_cross_byproduct_if-debug-in-release-graph build-Release.ninja echo_no_cross_byproduct_if:Debug) run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_dbg +run_ninja(CustomCommandOutputGenex echo_dbg-debug build-Debug.ninja echo_dbg) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_dbg-release build-Release.ninja echo_dbg) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_dbg-debug-in-release-graph build-Release.ninja echo_dbg:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +# echo_dbgx +run_ninja(CustomCommandOutputGenex echo_dbgx-debug build-Debug.ninja echo_dbgx) +run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_dbgx-release build-Release.ninja echo_dbgx) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) +run_ninja(CustomCommandOutputGenex echo_dbgx-debug-in-release-graph build-Release.ninja echo_dbgx:Debug) +run_ninja(CustomCommandOutputGenex clean-release-graph build-Release.ninja -t clean) # echo_target_raw run_ninja(CustomCommandOutputGenex echo_target_raw-debug build-Debug.ninja echo_target_raw:Debug) run_ninja(CustomCommandOutputGenex clean-debug-graph build-Debug.ninja -t clean) diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake index a26f632..494f87f 100644 --- a/Tests/RunCMake/RunCMake.cmake +++ b/Tests/RunCMake/RunCMake.cmake @@ -152,6 +152,7 @@ function(run_cmake test) "|clang[^:]*: warning: the object size sanitizer has no effect at -O0, but is explicitly enabled:" "|Error kstat returned" "|Hit xcodebuild bug" + "|Recompacting log\\.\\.\\." "|LICENSE WARNING:" "|Your license to use PGI[^\n]*expired" |