summarylogtreecommitdiffstats
path: root/boost-1.90.patch
blob: c50a9d1ed70dfaefe4b874a5516f818dd21a670e (plain)
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
--- a/cmake/dependencies/Boost_Sunshine.cmake
+++ b/cmake/dependencies/Boost_Sunshine.cmake
@@ -1,103 +1,13 @@
 #
-# Loads the boost library giving the priority to the system package first, with a fallback to FetchContent.
+# Use system-installed Boost
 #
 include_guard(GLOBAL)

-set(BOOST_VERSION "1.89.0")
-set(BOOST_COMPONENTS
+find_package(Boost REQUIRED COMPONENTS
         filesystem
         locale
         log
-        program_options
-        system
-)
-# system is not used by Sunshine, but by Simple-Web-Server, added here for convenience
-
-# algorithm, preprocessor, scope, and uuid are not used by Sunshine, but by libdisplaydevice, added here for convenience
-if(WIN32)
-    list(APPEND BOOST_COMPONENTS
-            algorithm
-            preprocessor
-            scope
-            uuid
-    )
-endif()
-
-if(BOOST_USE_STATIC)
-    set(Boost_USE_STATIC_LIBS ON)  # cmake-lint: disable=C0103
-endif()
-
-if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.30")
-    cmake_policy(SET CMP0167 NEW)  # Get BoostConfig.cmake from upstream
-endif()
-find_package(Boost CONFIG ${BOOST_VERSION} EXACT COMPONENTS ${BOOST_COMPONENTS})
-if(NOT Boost_FOUND)
-    message(STATUS "Boost v${BOOST_VERSION} package not found in the system. Falling back to FetchContent.")
-    include(FetchContent)
-
-    if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
-        cmake_policy(SET CMP0135 NEW)  # Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24
-    endif()
-    if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.31.0")
-        cmake_policy(SET CMP0174 NEW)  # Handle empty variables
-    endif()
-
-    # more components required for compiling boost targets
-    list(APPEND BOOST_COMPONENTS
-            asio
-            crc
-            format
-            process
-            property_tree)
-
-    set(BOOST_ENABLE_CMAKE ON)
-
-    # Limit boost to the required libraries only
-    set(BOOST_INCLUDE_LIBRARIES ${BOOST_COMPONENTS})
-    set(BOOST_URL "https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}-cmake.tar.xz")  # cmake-lint: disable=C0301
-    set(BOOST_HASH "SHA256=67acec02d0d118b5de9eb441f5fb707b3a1cdd884be00ca24b9a73c995511f74")
-
-    if(CMAKE_VERSION VERSION_LESS "3.24.0")
-        FetchContent_Declare(
-                Boost
-                URL ${BOOST_URL}
-                URL_HASH ${BOOST_HASH}
-        )
-    elseif(APPLE AND CMAKE_VERSION VERSION_GREATER_EQUAL "3.25.0")
-        # add SYSTEM to FetchContent_Declare, this fails on debian bookworm
-        FetchContent_Declare(
-                Boost
-                URL ${BOOST_URL}
-                URL_HASH ${BOOST_HASH}
-                SYSTEM  # requires CMake 3.25+
-                OVERRIDE_FIND_PACKAGE  # requires CMake 3.24+, but we have a macro to handle it for other versions
-        )
-    elseif(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
-        FetchContent_Declare(
-                Boost
-                URL ${BOOST_URL}
-                URL_HASH ${BOOST_HASH}
-                OVERRIDE_FIND_PACKAGE  # requires CMake 3.24+, but we have a macro to handle it for other versions
-        )
-    endif()
-
-    FetchContent_MakeAvailable(Boost)
-    set(FETCH_CONTENT_BOOST_USED TRUE)
-
-    set(Boost_FOUND TRUE)  # cmake-lint: disable=C0103
-    set(Boost_INCLUDE_DIRS  # cmake-lint: disable=C0103
-            "$<BUILD_INTERFACE:${Boost_SOURCE_DIR}/libs/headers/include>")
-
-    if(WIN32)
-        # Windows build is failing to create .h file in this directory
-        file(MAKE_DIRECTORY ${Boost_BINARY_DIR}/libs/log/src/windows)
-    endif()
-
-    set(Boost_LIBRARIES "")  # cmake-lint: disable=C0103
-    foreach(component ${BOOST_COMPONENTS})
-        list(APPEND Boost_LIBRARIES "Boost::${component}")
-    endforeach()
-endif()
+        program_options)

 message(STATUS "Boost include dirs: ${Boost_INCLUDE_DIRS}")
 message(STATUS "Boost libraries: ${Boost_LIBRARIES}")
--- a/cmake/macros/common.cmake
+++ b/cmake/macros/common.cmake
@@ -15,7 +15,7 @@
 endif()

 # override find_package function
-macro(find_package)  # cmake-lint: disable=C0103
+macro(_disable_find_package)  # cmake-lint: disable=C0103
     string(TOLOWER "${ARGV0}" ARGV0_LOWER)
     if(
         (("${ARGV0_LOWER}" STREQUAL "boost") AND DEFINED FETCH_CONTENT_BOOST_USED) OR
--- a/third-party/Simple-Web-Server/CMakeLists.txt
+++ b/third-party/Simple-Web-Server/CMakeLists.txt
@@ -41,8 +41,8 @@
         target_include_directories(simple-web-server SYSTEM INTERFACE ${ASIO_PATH})
     endif()
 else()
-    find_package(Boost 1.53.0 COMPONENTS system REQUIRED)
-    target_link_libraries(simple-web-server INTERFACE Boost::boost Boost::system)
+    find_package(Boost 1.53.0 REQUIRED)
+    target_link_libraries(simple-web-server INTERFACE Boost::boost)
     if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.9)
         target_compile_definitions(simple-web-server INTERFACE USE_BOOST_REGEX)
         find_package(Boost 1.53.0 COMPONENTS regex REQUIRED)