feat: make LLVM Demangle optional via CMake flag

Added new CMake option CITRON_USE_LLVM_DEMANGLE (default: ON) to control whether
the project uses LLVM's Demangle component. This allows building without LLVM
dependencies when demangling support is not needed.

Co-authored-by: reg_server
This commit is contained in:
Zephyron 2025-01-09 17:24:53 +10:00
parent 0cf545858d
commit d3ed42af8f
No known key found for this signature in database
GPG key ID: 8DA271B6A74353F1

View file

@ -66,6 +66,8 @@ option(CITRON_DOWNLOAD_TIME_ZONE_DATA "Always download time zone binaries" OFF)
option(CITRON_ENABLE_PORTABLE "Allow citron to enable portable mode if a user folder is found in the CWD" ON) option(CITRON_ENABLE_PORTABLE "Allow citron to enable portable mode if a user folder is found in the CWD" ON)
option(CITRON_USE_LLVM_DEMANGLE "Use LLVM Demangle" ON)
CMAKE_DEPENDENT_OPTION(CITRON_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF) CMAKE_DEPENDENT_OPTION(CITRON_USE_FASTER_LD "Check if a faster linker is available" ON "NOT WIN32" OFF)
CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF) CMAKE_DEPENDENT_OPTION(USE_SYSTEM_MOLTENVK "Use the system MoltenVK lib (instead of the bundled one)" OFF "APPLE" OFF)
@ -295,7 +297,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
find_package(Boost 1.79.0 REQUIRED context) find_package(Boost 1.79.0 REQUIRED context)
find_package(enet 1.3 MODULE) find_package(enet 1.3 MODULE)
find_package(fmt 9 REQUIRED) find_package(fmt 9 REQUIRED)
if (CITRON_USE_LLVM_DEMANGLE)
find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle) find_package(LLVM 17.0.2 MODULE COMPONENTS Demangle)
endif()
find_package(lz4 REQUIRED) find_package(lz4 REQUIRED)
find_package(nlohmann_json 3.8 REQUIRED) find_package(nlohmann_json 3.8 REQUIRED)
find_package(Opus 1.3 MODULE) find_package(Opus 1.3 MODULE)