diff options
author | Martin Duffy <martin.duffy@kitware.com> | 2022-05-16 21:27:37 (GMT) |
---|---|---|
committer | Martin Duffy <martin.duffy@kitware.com> | 2022-05-18 14:30:30 (GMT) |
commit | 65f7053d6c5a0d256691e156a22cc0e9f31a4d5a (patch) | |
tree | a29446f47f180b036e0d72041ce78b6d47e23f0b /Tests/RunCMake | |
parent | 76a08cd25332b74627802df8817068219b89161d (diff) | |
download | CMake-65f7053d6c5a0d256691e156a22cc0e9f31a4d5a.zip CMake-65f7053d6c5a0d256691e156a22cc0e9f31a4d5a.tar.gz CMake-65f7053d6c5a0d256691e156a22cc0e9f31a4d5a.tar.bz2 |
COMPILE_WARNING_AS_ERROR: Add command-line option
Add command-line option `--compile-no-warning-as-error` to ignore value of
`COMPILE_WARNING_AS_ERROR`.
Issue: #19085
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CompileWarningAsError/WerrorOnIgnore.cmake | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake b/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake index 059c80f..a532f72 100644 --- a/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake +++ b/Tests/RunCMake/CompileWarningAsError/RunCMakeTest.cmake @@ -3,10 +3,11 @@ include(RunCMake) function(run_compile_warn test) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build) set(RunCMake_TEST_OUTPUT_MERGE 1) - run_cmake(${test}) + run_cmake_with_options(${test} ${ARGN}) set(RunCMake_TEST_NO_CLEAN 1) run_cmake_command(${test}-Build ${CMAKE_COMMAND} --build . ${verbose_args}) endfunction() run_compile_warn(WerrorOn) run_compile_warn(WerrorOff) +run_compile_warn(WerrorOnIgnore "--compile-no-warning-as-error") diff --git a/Tests/RunCMake/CompileWarningAsError/WerrorOnIgnore.cmake b/Tests/RunCMake/CompileWarningAsError/WerrorOnIgnore.cmake new file mode 100644 index 0000000..1f7ccdb --- /dev/null +++ b/Tests/RunCMake/CompileWarningAsError/WerrorOnIgnore.cmake @@ -0,0 +1,8 @@ +enable_language(CXX) + +include(WarningAsErrorOptions.cmake) +get_warning_options(warning_options) + +add_executable(WerrorOn warn.cxx) +target_compile_options(WerrorOn PUBLIC "${warning_options}") +set_target_properties(WerrorOn PROPERTIES COMPILE_WARNING_AS_ERROR ON) |