aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 21 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6a22478e9..60fcf130e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,7 +187,7 @@ if(NOT MANUAL_SUBMODULES)
if (upToDate)
message(STATUS "Submodule '${relative_path}' is up-to-date")
else()
- message(FATAL_ERROR "Submodule '${relative_path}' is not up-to-date. Please update with\ngit submodule update --init --force ${relative_path}\nor run cmake with -DMANUAL_SUBMODULES=1")
+ message(FATAL_ERROR "Submodule '${relative_path}' is not up-to-date. Please update all submodules with\ngit submodule update --init --force\nor run cmake with -DMANUAL_SUBMODULES=1\n")
endif()
endfunction ()
@@ -246,6 +246,12 @@ enable_testing()
option(BUILD_DOCUMENTATION "Build the Doxygen documentation." ON)
option(BUILD_TESTS "Build tests." OFF)
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(DEFAULT_BUILD_DEBUG_UTILITIES ON)
+else()
+ set(DEFAULT_BUILD_DEBUG_UTILITIES OFF)
+endif()
+option(BUILD_DEBUG_UTILITIES "Build debug utilities." DEFAULT_BUILD_DEBUG_UTILITIES)
# Check whether we're on a 32-bit or 64-bit system
if(CMAKE_SIZEOF_VOID_P EQUAL "8")
@@ -645,7 +651,7 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
# if those don't work for your compiler, single it out where appropriate
- if(CMAKE_BUILD_TYPE STREQUAL "Release")
+ if(CMAKE_BUILD_TYPE STREQUAL "Release" AND NOT OPENBSD)
set(C_SECURITY_FLAGS "${C_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
set(CXX_SECURITY_FLAGS "${CXX_SECURITY_FLAGS} -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1")
endif()
@@ -657,7 +663,7 @@ else()
add_cxx_flag_if_supported(-Wformat-security CXX_SECURITY_FLAGS)
# -fstack-protector
- if (NOT WIN32)
+ if (NOT WIN32 AND NOT OPENBSD)
add_c_flag_if_supported(-fstack-protector C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fstack-protector CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-fstack-protector-strong C_SECURITY_FLAGS)
@@ -665,7 +671,7 @@ else()
endif()
# New in GCC 8.2
- if (NOT WIN32)
+ if (NOT WIN32 AND NOT OPENBSD)
add_c_flag_if_supported(-fcf-protection=full C_SECURITY_FLAGS)
add_cxx_flag_if_supported(-fcf-protection=full CXX_SECURITY_FLAGS)
add_c_flag_if_supported(-fstack-clash-protection C_SECURITY_FLAGS)
@@ -878,10 +884,10 @@ if (${BOOST_IGNORE_SYSTEM_PATHS} STREQUAL "ON")
endif()
set(OLD_LIB_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
+set(Boost_NO_BOOST_CMAKE ON)
if(STATIC)
if(MINGW)
set(CMAKE_FIND_LIBRARY_SUFFIXES .a)
- set(Boost_NO_BOOST_CMAKE ON)
endif()
set(Boost_USE_STATIC_LIBS ON)
@@ -997,8 +1003,18 @@ endif()
add_subdirectory(contrib)
add_subdirectory(src)
+find_package(PythonInterp)
if(BUILD_TESTS)
+ message(STATUS "Building tests")
add_subdirectory(tests)
+else()
+ message(STATUS "Not building tests")
+endif()
+
+if(BUILD_DEBUG_UTILITIES)
+ message(STATUS "Building debug utilities")
+else()
+ message(STATUS "Not building debug utilities")
endif()
if(BUILD_DOCUMENTATION)
@@ -1032,5 +1048,3 @@ option(INSTALL_VENDORED_LIBUNBOUND "Install libunbound binary built from source
CHECK_C_COMPILER_FLAG(-std=c11 HAVE_C11)
-
-find_package(PythonInterp)