mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 08:40:11 -06:00
Add `COMPILE_WARNING_AS_ERROR` target property and supporting `CMAKE_COMPILE_WARNING_AS_ERROR` variable. `COMPILE_WARNING_AS_ERROR` is initialized by `CMAKE_COMPILE_WARNING_AS_ERROR`. It is a boolean variable. If it is true, it expands to a different flag depending on the compiler such that any warnings at compile will be treated as errors. Supports compiler ids that I could find a relevant flag for.
13 lines
357 B
CMake
13 lines
357 B
CMake
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})
|
|
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)
|