aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt28
1 files changed, 23 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c19c9dba7..54bc948e4 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")
@@ -672,8 +678,11 @@ else()
add_cxx_flag_if_supported(-fstack-clash-protection CXX_SECURITY_FLAGS)
endif()
- add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
- add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
+ # Removed in GCC 9.1 (or before ?), but still accepted, so spams the output
+ if (NOT (CMAKE_C_COMPILER_ID STREQUAL "GNU" AND NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 9.1))
+ add_c_flag_if_supported(-mmitigate-rop C_SECURITY_FLAGS)
+ add_cxx_flag_if_supported(-mmitigate-rop CXX_SECURITY_FLAGS)
+ endif()
# linker
if (NOT WIN32)
@@ -898,9 +907,9 @@ elseif(Boost_FOUND)
set(BOOST_BEFORE_1_62 true)
endif()
if (BOOST_BEFORE_1_62)
- message(FATAL_ERROR "Boost older than 1.62 is too old to link with OpenSSL 1.1 or newer. "
+ message(FATAL_ERROR "Boost ${Boost_VERSION} (older than 1.62) is too old to link with OpenSSL ${OPENSSL_VERSION} (1.1 or newer) found at ${OPENSSL_INCLUDE_DIR} and ${OPENSSL_LIBRARIES}. "
"Update Boost or install OpenSSL 1.0 and set path to it when running cmake: "
- "cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0;/usr/lib/openssl-1.0'")
+ "cmake -DOPENSSL_ROOT_DIR='/usr/include/openssl-1.0'")
endif()
endif()
@@ -995,7 +1004,16 @@ add_subdirectory(contrib)
add_subdirectory(src)
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)