Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+

cmake_minimum_required(VERSION 2.8.8)
# CMake 3.8 is required, CMake policy compatibility was verified up to 3.17.
cmake_minimum_required(VERSION 3.8...3.17)
set(BOOST_MIN_VERSION "1.66.0")

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
Comment on lines +7 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#10402 just removed the version check around the already existing block, but it didn't add that one.

So far, the support/2.13 branch is still using a way older standard:

icinga2/CMakeLists.txt

Lines 405 to 406 in b060f1d

if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")

I'd probably leave it as is here (i.e. just remove these three set()). It's questionable whether there will even be a further 2.13.x release, we're pretty much only doing this change the need for a security fix release arises, we can still build it without issues on our Windows build machines without annoying surprises.


project(icinga2)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third-party/cmake")
Expand All @@ -13,6 +18,10 @@ if(NOT CMAKE_BUILD_TYPE)
FORCE)
endif()

# Include symbols in executables so that function names can be printed in stack traces, for example in crash dumps.
set(CMAKE_ENABLE_EXPORTS ON) # Added in CMake 3.4
set(CMAKE_EXECUTABLE_ENABLE_EXPORTS ON) # Added in CMake 3.27 and supersedes the above one.

option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
Expand Down Expand Up @@ -225,7 +234,6 @@ if(WIN32)
list(APPEND base_DEPS ws2_32 dbghelp shlwapi msi)
endif()

set(CMAKE_MACOSX_RPATH 1)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_FULL_LIBDIR}/icinga2")

if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
Expand Down
4 changes: 4 additions & 0 deletions icinga-installer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ set_target_properties(
FOLDER Bin
OUTPUT_NAME icinga2-installer
LINK_FLAGS "/SUBSYSTEM:WINDOWS"

# Use a statically-linked runtime library as this binary is run during the installation process where the other DLLs
# may not have been installed already and the system-provided version may be too old.
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
)

target_link_libraries(icinga-installer shlwapi)
Expand Down
Loading