From a9e5b1518f2b80d0ca9326508b776438b8d69884 Mon Sep 17 00:00:00 2001 From: David Wagner Date: Tue, 17 May 2016 17:07:39 +0200 Subject: [PATCH] CMake: Use add_compile_options when applicable Instead of using set_property(DIRECTORY COMPILE_OPTIONS), use add_compile_options, which applies to the current directory and all subdirs. Signed-off-by: David Wagner --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0323247c6..463f45fc4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,12 +80,12 @@ if(WIN32) # and thus are not to be used by the client. A better fix would be to export # only public methods instead of the whole class, but they are too many to # do that. A separated plugin interface would fix that. - set_property(DIRECTORY PROPERTY COMPILE_OPTIONS /W4 /FIiso646.h -wd4127 -wd4251) + add_compile_options(/W4 /FIiso646.h -wd4127 -wd4251) # FIXME: Once we have removed all warnings on windows, add the /WX flags if # FATAL_WARNINGS is enabled else() - set_property(DIRECTORY PROPERTY COMPILE_OPTIONS -Wall -Wextra -Wconversion -Wno-sign-conversion + add_compile_options(-Wall -Wextra -Wconversion -Wno-sign-conversion $<$:-Werror>) endif()