mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 20:46:37 +08:00
Tests: Isolate RunCMake.LinkWarningAsError from -Werror flags in environment
Fixes: #26836
This commit is contained in:
@@ -1,5 +1,15 @@
|
||||
include(RunCMake)
|
||||
|
||||
# Isolate test cases from the caller's environment.
|
||||
if(DEFINED ENV{CFLAGS})
|
||||
string(REGEX REPLACE "-Werror[^ ]*" "" cflags "$ENV{CFLAGS}")
|
||||
set(ENV{CFLAGS} "${cflags}")
|
||||
endif()
|
||||
if(DEFINED ENV{LDFLAGS})
|
||||
string(REGEX REPLACE "-Wl,--fatal-warnings[^ ]*" "" ldflags "$ENV{LDFLAGS}")
|
||||
set(ENV{LDFLAGS} "${ldflags}")
|
||||
endif()
|
||||
|
||||
run_cmake(BadValue)
|
||||
|
||||
function(run_link_warn test)
|
||||
|
Reference in New Issue
Block a user