Update regex to match correct pattern. (#20483)

In CMakeLists.txt:set_msvc_c_cpp_compiler_warning_level(), the regex should match the value that gets added by the function. The latter got updated, so this change updates the former to match.
This commit is contained in:
Edward Chen 2024-04-29 10:43:31 -07:00 committed by GitHub
parent 49b2bebe85
commit 358f5bb022
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -383,7 +383,7 @@ function(set_msvc_c_cpp_compiler_warning_level warning_level)
get_property(opts DIRECTORY PROPERTY COMPILE_OPTIONS)
# only match the generator expression added by this function
list(FILTER opts
EXCLUDE REGEX "^\\$<\\$<OR:\\$<COMPILE_LANGUAGE:C>,\\$<COMPILE_LANGUAGE:CXX>>:/W[0-4]>$")
EXCLUDE REGEX "^\\$<\\$<COMPILE_LANGUAGE:CXX,C>:/W[0-4]>$")
list(APPEND opts "$<$<COMPILE_LANGUAGE:CXX,C>:${warning_flag}>")
set_property(DIRECTORY PROPERTY COMPILE_OPTIONS "${opts}")
endif()