mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Merge topic 'test-tolerate-env-Werror' into release-4.0
2f9211b4e4
Tests: Isolate RunCMake.LinkWarningAsError from -Werror flags in environment
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !10587
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