diff --git a/llvm/cmake/modules/HandleLLVMOptions.cmake b/llvm/cmake/modules/HandleLLVMOptions.cmake index 0942bb98a26f..cd48f93f80ca 100644 --- a/llvm/cmake/modules/HandleLLVMOptions.cmake +++ b/llvm/cmake/modules/HandleLLVMOptions.cmake @@ -59,7 +59,7 @@ if( LLVM_ENABLE_ASSERTIONS ) 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