1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
|
From 0a7173d40d14c8488892ef5fafb8fb58d05c6b57 Mon Sep 17 00:00:00 2001
From: Andreas Sturmlechner <asturm@gentoo.org>
Date: Sun, 19 Oct 2025 21:05:39 +0200
Subject: [PATCH] Raise Boost minimum version to 1.70
Boost 1.70 was released on April 12th, 2019
This solves multiple issues:
- Mainly, with <boost-1.89, the second FindBoost call for System reset
Boost_IOSTREAMS_FOUND since 99348321819fe8efb3771b2dcd9aaffbc598b271,
ending up never checking BOOST_IOSTREAMS_HAS_ZSTD
- Boost-1.70 introduced their BoostConfig.cmake upstream cmake module
which CMake Policy CMP0167 drives to port away to (fixes warning
introduced with CMake >=3.30
- Boost-1.69 introduced zstd compression/decompression filter, so the
bundled lib is unnecessary
- Boost-1.69 made Boost.System header-only, providing a stub library,
so we can simply drop all references - see also:
https://www.boost.org/doc/libs/1_69_0/libs/system/doc/html/system.html#changes_in_boost_1_69
Further fix:
- Do not expand variables beforehand - see also:
https://invent.kde.org/plasma/libplasma/-/merge_requests/267
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
---
CMakeLists.txt | 10 ++--------
src/analyze/CMakeLists.txt | 2 +-
src/interpret/CMakeLists.txt | 2 +-
tests/auto/CMakeLists.txt | 7 ++-----
tests/auto/no_asan/CMakeLists.txt | 3 +--
5 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index adc08a3..6846c11 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,18 +25,12 @@ if (APPIMAGE_BUILD)
endif()
include(FeatureSummary)
-find_package(Boost 1.60.0 ${REQUIRED_IN_APPIMAGE} COMPONENTS filesystem iostreams container)
-# boost_system no longer exists in 1.89
-if (Boost_VERSION VERSION_LESS 1.89.0)
- find_package(Boost ${REQUIRED_IN_APPIMAGE} COMPONENTS system)
-else()
- set(Boost_SYSTEM_FOUND TRUE)
-endif()
+find_package(Boost 1.70.0 CONFIG ${REQUIRED_IN_APPIMAGE} COMPONENTS filesystem iostreams container)
set_package_properties(Boost PROPERTIES TYPE RECOMMENDED PURPOSE "Boost container libraries can greatly improve performance (via pmr allocators)")
find_package(Threads REQUIRED)
find_package(ZLIB REQUIRED)
-if (${Boost_IOSTREAMS_FOUND})
+if (Boost_IOSTREAMS_FOUND)
find_package(ZSTD ${REQUIRED_IN_APPIMAGE})
include(CheckCXXSourceCompiles)
diff --git a/src/analyze/CMakeLists.txt b/src/analyze/CMakeLists.txt
index 340eb7f..3bb44d2 100644
--- a/src/analyze/CMakeLists.txt
+++ b/src/analyze/CMakeLists.txt
@@ -2,7 +2,7 @@ if (ECM_FOUND)
include(ECMEnableSanitizers)
endif()
-find_package(Boost 1.41.0 REQUIRED COMPONENTS iostreams program_options filesystem)
+find_package(Boost 1.70.0 CONFIG REQUIRED COMPONENTS iostreams program_options filesystem)
configure_file(analyze_config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/analyze_config.h)
diff --git a/src/interpret/CMakeLists.txt b/src/interpret/CMakeLists.txt
index ef0d5be..6cd0857 100644
--- a/src/interpret/CMakeLists.txt
+++ b/src/interpret/CMakeLists.txt
@@ -3,7 +3,7 @@ if (ECM_FOUND)
endif()
find_package(Elfutils 0.158 REQUIRED)
-find_package(Boost 1.41.0 REQUIRED COMPONENTS program_options)
+find_package(Boost 1.70.0 CONFIG REQUIRED COMPONENTS program_options)
include_directories(
${PROJECT_SOURCE_DIR}/3rdparty/
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt
index c4959cc..be9712c 100644
--- a/tests/auto/CMakeLists.txt
+++ b/tests/auto/CMakeLists.txt
@@ -11,7 +11,7 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../../src/track
)
-if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
+if (Boost_FILESYSTEM_FOUND)
if (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
set(LIBUTIL_LIBRARY "util")
endif()
@@ -44,7 +44,7 @@ add_test(NAME tst_trace COMMAND tst_trace)
configure_file(tst_heaptrack_interpret.cmake.sh ${CMAKE_CURRENT_BINARY_DIR}/tst_heaptrack_interpret.sh @ONLY)
add_test(NAME tst_heaptrack_interpret COMMAND ${CMAKE_CURRENT_BINARY_DIR}/tst_heaptrack_interpret.sh)
-if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
+if (Boost_FILESYSTEM_FOUND)
add_executable(tst_libheaptrack
tst_libheaptrack.cpp
../../src/track/libheaptrack.cpp)
@@ -56,7 +56,6 @@ if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
${LIBUTIL_LIBRARY}
heaptrack_unwind
rt
- ${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
add_test(NAME tst_libheaptrack COMMAND tst_libheaptrack)
@@ -64,7 +63,6 @@ if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
add_executable(tst_io tst_io.cpp)
set_target_properties(tst_io PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}")
target_link_libraries(tst_io
- ${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
add_test(NAME tst_io COMMAND tst_io)
@@ -75,7 +73,6 @@ if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
add_executable(tst_parser tst_parser.cpp)
set_target_properties(tst_parser PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}")
target_link_libraries(tst_parser
- ${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
heaptrack_gui_private
Qt6::Test
diff --git a/tests/auto/no_asan/CMakeLists.txt b/tests/auto/no_asan/CMakeLists.txt
index 1aed05d..927e6ff 100644
--- a/tests/auto/no_asan/CMakeLists.txt
+++ b/tests/auto/no_asan/CMakeLists.txt
@@ -1,9 +1,8 @@
-if ("${Boost_FILESYSTEM_FOUND}" AND "${Boost_SYSTEM_FOUND}")
+if (Boost_FILESYSTEM_FOUND)
add_executable(tst_inject tst_inject.cpp)
set_target_properties(tst_inject PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${BIN_INSTALL_DIR}")
target_link_libraries(tst_inject
${CMAKE_DL_LIBS}
- ${Boost_SYSTEM_LIBRARY}
${Boost_FILESYSTEM_LIBRARY}
)
add_test(NAME tst_inject COMMAND tst_inject)
--
2.51.1
|