diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4aad8746..c298b981 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12.2) +cmake_minimum_required(VERSION 2.8.12.2...3.28.1) cmake_policy(VERSION ${CMAKE_VERSION}) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") @@ -8,8 +8,8 @@ project(ouroboros C) include(GNUInstallDirs) set(PACKAGE_VERSION_MAJOR 0) -set(PACKAGE_VERSION_MINOR 19) -set(PACKAGE_VERSION_PATCH 1) +set(PACKAGE_VERSION_MINOR 21) +set(PACKAGE_VERSION_PATCH 3) set(PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(PACKAGE_DESCRIPTION "The Ouroboros prototype") @@ -93,21 +93,28 @@ test_and_set_c_compiler_flag_global(-Wunreachable-code) test_and_set_c_compiler_flag_global(-Wdeclaration-after-statement) test_and_set_c_compiler_flag_global(-Winfinite-recursion) test_and_set_c_compiler_flag_global(-fmax-errors=5) + if (CMAKE_BUILD_TYPE STREQUAL "Release") test_and_set_c_compiler_flag_global(-O3) -else () +elseif (CMAKE_BUILD_TYPE STREQUAL "Debug") + test_and_set_c_compiler_flag_global(-g) +elseif (CMAKE_BUILD_TYPE STREQUAL "DebugASan") test_and_set_c_compiler_flag_global(-g) -endif () -if (CMAKE_BUILD_TYPE STREQUAL "DebugASan") test_and_set_c_compiler_flag_global(-fsanitize=address) elseif (CMAKE_BUILD_TYPE STREQUAL "DebugTSan") + test_and_set_c_compiler_flag_global(-g) test_and_set_c_compiler_flag_global(-fsanitize=thread) elseif (CMAKE_BUILD_TYPE STREQUAL "DebugLSan") + test_and_set_c_compiler_flag_global(-g) test_and_set_c_compiler_flag_global(-fsanitize=leak) elseif (CMAKE_BUILD_TYPE STREQUAL "DebugUSan") + test_and_set_c_compiler_flag_global(-g) test_and_set_c_compiler_flag_global(-fsanitize=undefined) elseif (CMAKE_BUILD_TYPE STREQUAL "DebugAnalyzer") + test_and_set_c_compiler_flag_global(-g) test_and_set_c_compiler_flag_global(-fanalyzer) +else () + message(FATAL_ERROR "Unkown build type ${CMAKE_BUILD_TYPE}") endif () configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros-dev.pc.in" @@ -135,6 +142,11 @@ if (SYSTEMD_FOUND) endif () if (NOT ${SYSTEMD_UNITDIR} STREQUAL "") message(STATUS "Installing systemd service in: ${SYSTEMD_UNITDIR}") + if (LIBTOML_LIBRARIES AND NOT DISABLE_CONFIGFILE) + set (CONFIGURE_STRING "--config ${OUROBOROS_CONFIG_DIR}${OUROBOROS_CONFIG_FILE}") + else () + set (CONFIGURE_STRING "") + endif () configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.service.in" "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" @ONLY) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ouroboros.service" |