diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 23657d3379fae..7efb8318bbba6 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -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 "^\\$<\\$,\\$>:/W[0-4]>$") + EXCLUDE REGEX "^\\$<\\$:/W[0-4]>$") list(APPEND opts "$<$:${warning_flag}>") set_property(DIRECTORY PROPERTY COMPILE_OPTIONS "${opts}") endif()