diff options
author | Aurélien Gâteau <agateau@kde.org> | 2014-01-29 11:14:43 +0100 |
---|---|---|
committer | Aurélien Gâteau <agateau@kde.org> | 2014-01-29 16:14:41 +0100 |
commit | cf6070c980f7b9465ce7ad850291663210b9ea53 (patch) | |
tree | b1306ebb90da065d231b165430b296b68f5131b4 | |
parent | 455483e482f9bcc861d20e178c3d2ba3223a22e0 (diff) | |
download | extra-cmake-modules-cf6070c980f7b9465ce7ad850291663210b9ea53.tar.gz extra-cmake-modules-cf6070c980f7b9465ce7ad850291663210b9ea53.tar.bz2 |
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
-rw-r--r-- | kde-modules/KDECompilerSettings.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
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() |