1 parent
df99b6ea7f
commit
d146f11f02
63 files changed
+8331
-2709
No files matched your search
+58
-14
@@ -68,21 +68,44 @@ if(quickjs_SOURCE_DIR)
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(AddBoost.cmake_VERSION 3.7.3)
|
||||
CPMAddPackage(
|
||||
NAME AddBoost.cmake
|
||||
VERSION "${AddBoost.cmake_VERSION}"
|
||||
URL "https://github.com/Arniiiii/AddBoost.cmake/archive/refs/tags/${AddBoost.cmake_VERSION}.tar.gz"
|
||||
)
|
||||
set(TRY_BOOST_VERSION "1.90.0")
|
||||
set(BOOST_MY_OPTIONS "BOOST_ENABLE_PYTHON ON;")
|
||||
set(BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "thread;system")
|
||||
set(BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "asio;beast;uuid;container;cobalt;url")
|
||||
# Boost: the process must contain exactly ONE copy of the compiled Boost
|
||||
# libraries. VoidLibrary links the SYSTEM Boost, so EchoionCore must use the
|
||||
# same one — vendoring a second copy (the old AddBoost path fetched 1.90
|
||||
# alongside the system 1.91) put two libboost_url.so versions into the
|
||||
# process and the cross-bound symbols corrupted every parsed URL
|
||||
# (SIGSEGV in boost::urls::url_view). Fall back to fetching only when no
|
||||
# usable system Boost exists (in which case Void fetched the same one).
|
||||
find_package(Boost 1.87 CONFIG QUIET COMPONENTS url thread container)
|
||||
if(Boost_FOUND)
|
||||
message(STATUS "EchoionCore using system Boost ${Boost_VERSION}")
|
||||
# Distros ship CMake configs only for the compiled Boost libraries;
|
||||
# header-only components (asio, beast, uuid) have none. Map the targets
|
||||
# EchoionCore links onto the installed headers.
|
||||
foreach(_hdr asio beast uuid system)
|
||||
if(NOT TARGET Boost::${_hdr})
|
||||
add_library(_boost_${_hdr}_hdr INTERFACE)
|
||||
add_library(Boost::${_hdr} ALIAS _boost_${_hdr}_hdr)
|
||||
target_include_directories(_boost_${_hdr}_hdr INTERFACE
|
||||
"${Boost_INCLUDE_DIRS}")
|
||||
endif()
|
||||
endforeach()
|
||||
else()
|
||||
set(AddBoost.cmake_VERSION 3.7.3)
|
||||
CPMAddPackage(
|
||||
NAME AddBoost.cmake
|
||||
VERSION "${AddBoost.cmake_VERSION}"
|
||||
URL "https://github.com/Arniiiii/AddBoost.cmake/archive/refs/tags/${AddBoost.cmake_VERSION}.tar.gz"
|
||||
)
|
||||
set(TRY_BOOST_VERSION "1.90.0")
|
||||
set(BOOST_MY_OPTIONS "BOOST_ENABLE_PYTHON ON;")
|
||||
set(BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "thread;system")
|
||||
set(BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED "asio;beast;uuid;container;cobalt;url")
|
||||
|
||||
add_boost(
|
||||
TRY_BOOST_VERSION BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED
|
||||
BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED EchoionCore
|
||||
)
|
||||
add_boost(
|
||||
TRY_BOOST_VERSION BOOST_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED
|
||||
BOOST_NOT_HEADER_ONLY_COMPONENTS_THAT_YOU_NEED EchoionCore
|
||||
)
|
||||
endif()
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
@@ -126,6 +149,27 @@ else()
|
||||
target_compile_options(EchoionCore PRIVATE -Wall -Wextra -Wpedantic)
|
||||
endif()
|
||||
|
||||
# Precompiled headers for the heavy translation units (MusicManager.cpp ~2.4k
|
||||
# lines, Core.cpp, YouTubeClient.cpp). These pull in the same expensive standard
|
||||
# and Void headers, so compiling them once cuts a large slice off build time.
|
||||
# Disabled automatically under unity builds (CMake forbids combining the two).
|
||||
option(ECHOION_ENABLE_PCH "Use precompiled headers for EchoionCore" ON)
|
||||
if(ECHOION_ENABLE_PCH AND NOT CMAKE_UNITY_BUILD)
|
||||
target_precompile_headers(EchoionCore PRIVATE
|
||||
<string>
|
||||
<string_view>
|
||||
<vector>
|
||||
<memory>
|
||||
<optional>
|
||||
<chrono>
|
||||
<format>
|
||||
<mutex>
|
||||
<thread>
|
||||
<atomic>
|
||||
<functional>
|
||||
)
|
||||
endif()
|
||||
|
||||
set_target_properties(EchoionCore PROPERTIES
|
||||
OUTPUT_NAME "Echoion"
|
||||
PREFIX ""
|
||||
|
||||
Reference in new issue
Block a user