Skip to content

Commit 331ab06

Browse files
authored
Merge pull request #10625 from Icinga/cmake4-compat-2.13
Backport changes to increase the CMake minimum version to 3.8 to support 2.13 support branch
2 parents bf5287c + c59cd55 commit 331ab06

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

CMakeLists.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+
22

3-
cmake_minimum_required(VERSION 2.8.8)
3+
# CMake 3.8 is required, CMake policy compatibility was verified up to 3.17.
4+
cmake_minimum_required(VERSION 3.8...3.17)
45
set(BOOST_MIN_VERSION "1.66.0")
56

67
project(icinga2)
@@ -13,6 +14,10 @@ if(NOT CMAKE_BUILD_TYPE)
1314
FORCE)
1415
endif()
1516

17+
# Include symbols in executables so that function names can be printed in stack traces, for example in crash dumps.
18+
set(CMAKE_ENABLE_EXPORTS ON) # Added in CMake 3.4
19+
set(CMAKE_EXECUTABLE_ENABLE_EXPORTS ON) # Added in CMake 3.27 and supersedes the above one.
20+
1621
option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON)
1722
option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON)
1823
option(ICINGA2_WITH_CHECKER "Build the checker module" ON)
@@ -225,7 +230,6 @@ if(WIN32)
225230
list(APPEND base_DEPS ws2_32 dbghelp shlwapi msi)
226231
endif()
227232

228-
set(CMAKE_MACOSX_RPATH 1)
229233
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH};${CMAKE_INSTALL_FULL_LIBDIR}/icinga2")
230234

231235
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")

icinga-installer/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ set_target_properties(
1919
FOLDER Bin
2020
OUTPUT_NAME icinga2-installer
2121
LINK_FLAGS "/SUBSYSTEM:WINDOWS"
22+
23+
# Use a statically-linked runtime library as this binary is run during the installation process where the other DLLs
24+
# may not have been installed already and the system-provided version may be too old.
25+
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>"
2226
)
2327

2428
target_link_libraries(icinga-installer shlwapi)

0 commit comments

Comments
 (0)