diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -59,7 +59,7 @@ if( NOT uppercase_CMAKE_BUILD_TYPE STREQUAL "DEBUG" ) # NOTE: use `add_compile_options` rather than `add_definitions` since # `add_definitions` does not support generator expressions. - add_compile_options($<$:-UNDEBUG>) + add_compile_options($<$,$>:-UNDEBUG>) # Also remove /D NDEBUG to avoid MSVC warnings about conflicting defines. foreach (flags_var_to_scrub