From cf6070c980f7b9465ce7ad850291663210b9ea53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20G=C3=A2teau?= Date: Wed, 29 Jan 2014 11:14:43 +0100 Subject: KDE_SOURCE_FILES_ENABLE_EXCEPTIONS: Handle case where COMPILE_FLAGS is not set When COMPILE_FLAGS is not set, get_source_file_property(flags ${source_file} COMPILEFLAGS) set flags to "NOTFOUND". Leading to interesting build failures in kde-runtime when we then set flags to "NOTFOUND -fexceptions", see http://build.kde.org/job/kde-runtime_frameworks_qt5/58/ REVIEW: 115376 --- kde-modules/KDECompilerSettings.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/kde-modules/KDECompilerSettings.cmake b/kde-modules/KDECompilerSettings.cmake index bcc11284..62ba4a0a 100644 --- a/kde-modules/KDECompilerSettings.cmake +++ b/kde-modules/KDECompilerSettings.cmake @@ -192,6 +192,13 @@ endmacro() function(KDE_SOURCE_FILES_ENABLE_EXCEPTIONS) foreach(source_file ${ARGV}) get_source_file_property(flags ${source_file} COMPILE_FLAGS) + if(NOT flags) + # If COMPILE_FLAGS is not set, get_source_file_property() sets it to + # NOTFOUND, which breaks build if we concatenate anything to + # the "NOTFOUND" string. + # Note that NOTFOUND evaluates to False, so we do enter the if. + set(flags "") + endif() _kdecompilersettings_append_exception_flag(flags) set_source_files_properties(${source_file} COMPILE_FLAGS "${flags}") endforeach() -- cgit v1.2.1