| 1 |
enable_language(${LANGUAGE}) |
| 2 |
|
| 3 |
include(WarningAsErrorOptions.cmake) |
| 4 |
get_warning_options(warning_options ${LANGUAGE}) |
| 5 |
|
| 6 |
if(NOT DEFINED FILENAME) |
| 7 |
set(FILENAME warn) |
| 8 |
endif() |
| 9 |
|
| 10 |
if (DEFINED warning_options) |
| 11 |
add_executable(WerrorOn ${FILENAME}.${EXTENSION}) |
| 12 |
target_compile_options(WerrorOn PUBLIC "${warning_options}") |
| 13 |
set_target_properties(WerrorOn PROPERTIES COMPILE_WARNING_AS_ERROR ON) |
| 14 |
else() |
| 15 |
# if no werror option is set for the environment, use err so that build fails as expected |
| 16 |
add_executable(WerrorOn err.${EXTENSION}) |
| 17 |
endif() |