aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 14 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 49b256edb..1f74f59e3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,7 +186,7 @@ endif()
# elseif(CMAKE_SYSTEM_NAME MATCHES ".*BSDI.*")
# set(BSDI TRUE)
-include_directories(external/easylogging++ src contrib/epee/include external "${CMAKE_BINARY_DIR}/version")
+include_directories(external/easylogging++ src contrib/epee/include external)
if(APPLE)
include_directories(SYSTEM /usr/include/malloc)
@@ -234,6 +234,7 @@ if(STATIC)
else()
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
endif()
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DZMQ_STATIC")
endif()
# Set default blockchain storage location:
@@ -407,7 +408,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")
@@ -691,25 +692,17 @@ include(version.cmake)
find_path(ZMQ_INCLUDE_PATH zmq.hpp)
find_library(ZMQ_LIB zmq)
+find_library(SODIUM_LIBRARY sodium)
if(NOT ZMQ_INCLUDE_PATH)
message(FATAL_ERROR "Could not find required header zmq.hpp")
endif()
if(NOT ZMQ_LIB)
- message(FATAL_ERROR "Could not find require libzmq")
+ message(FATAL_ERROR "Could not find required libzmq")
+endif()
+if(SODIUM_LIBRARY)
+ set(ZMQ_LIB "${ZMQ_LIB};${SODIUM_LIBRARY}")
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)
@@ -717,7 +710,13 @@ 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)")