diff options
author | Riccardo Spagni <ric@spagni.net> | 2017-09-25 16:45:52 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2017-09-25 16:45:52 +0200 |
commit | c339d06a5b28b7afb2283b59c786bb6e27cbce1e (patch) | |
tree | c11b411d773ea1286d1185444dbe81ace8478107 | |
parent | Merge pull request #2398 (diff) | |
parent | cmake: make warning about headers not fatal (diff) | |
download | monero-c339d06a5b28b7afb2283b59c786bb6e27cbce1e.tar.xz |
Merge pull request #2418
50431112 cmake: make warning about headers not fatal (redfish)
0a70ba2c cmake: fix setting of -Werror (redfish)
-rw-r--r-- | CMakeLists.txt | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 971c097ff..486a80b4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -407,7 +407,7 @@ else() set(WARNINGS "${WARNINGS} -Wno-error=inline-asm") endif() else() - set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized") + set(WARNINGS "${WARNINGS} -Wlogical-op -Wno-error=maybe-uninitialized -Wno-error=cpp") endif() if(MINGW) set(WARNINGS "${WARNINGS} -Wno-error=unused-value -Wno-error=unused-but-set-variable") @@ -699,25 +699,19 @@ if(NOT ZMQ_LIB) message(FATAL_ERROR "Could not find require libzmq") endif() -function (treat_warnings_as_errors dirs) - foreach(dir ${ARGV}) - set_property(DIRECTORY ${dir} - APPEND PROPERTY COMPILE_FLAGS "-Werror") - endforeach() -endfunction() - -add_subdirectory(contrib) -add_subdirectory(src) - -treat_warnings_as_errors(contrib src) - option(BUILD_TESTS "Build tests." OFF) if(BUILD_TESTS) add_subdirectory(tests) endif() +# warnings are cleared only for GCC on Linux +if (NOT (MINGW OR APPLE OR FREEBSD OR OPENBSD OR DRAGONFLY)) +add_compile_options("${WARNINGS_AS_ERRORS_FLAG}") # applies only to targets that follow +endif() +add_subdirectory(contrib) +add_subdirectory(src) if(BUILD_DOCUMENTATION) set(DOC_GRAPHS "YES" CACHE STRING "Create dependency graphs (needs graphviz)") |