mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
20 lines
652 B
CMake
20 lines
652 B
CMake
|
|
set(reference_file "${RunCMake_TEST_BINARY_DIR}/WARNING_AS_ERROR.txt")
|
|
if (NOT EXISTS "${reference_file}")
|
|
set (RunCMake_TEST_FAILED "${reference_file}: Reference file not found.")
|
|
return()
|
|
endif()
|
|
file(READ "${reference_file}" WarnErrorFlags)
|
|
|
|
if(NOT WarnErrorFlags STREQUAL "UNDEFINED")
|
|
if(WARNING_AS_ERROR)
|
|
if(NOT actual_stdout MATCHES "${WarnErrorFlags}")
|
|
set (RunCMake_TEST_FAILED "LINK_WARNING_AS_ERROR: flag is missing.")
|
|
endif()
|
|
else()
|
|
if(actual_stdout MATCHES "${WarnErrorFlags}")
|
|
set (RunCMake_TEST_FAILED "LINK_WARNING_AS_ERROR: flag unexpectedly present: '${WarnErrorFlags}'")
|
|
endif()
|
|
endif()
|
|
endif()
|