From 1046b122a30d5f70af379ae3c71d760f4b11b2e9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 22 Jan 2020 02:35:11 -0700 Subject: [PATCH] CMake: Fix Interrogate macro sometimes passing -D'' --- cmake/macros/Interrogate.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 9001d05ff1..6809d8eaec 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -218,7 +218,10 @@ function(interrogate_sources target output database language_flags) # that's fine, it also ignores '"' set(_q "'") endif() - set(define_flags "$<$:-D${_q}$${_q}>") + set(_compile_defs_flags "-D${_q}$${_q}") + # We may have just ended up with -D'' if there are no flags; filter that + set(define_flags + "$<$>:${_compile_defs_flags}>") # Some of the definitions may be specified using -D flags in the global # CXX_FLAGS variables; parse those out (this also picks up NDEBUG)