Add optional dependencies to Brewfile and improve CMake configuration
This commit updates the Brewfile to include additional optional dependencies such as Vulkan headers, RapidJSON, and various libraries for enhanced functionality. It also modifies CMake files to make the handling of optional components more user-friendly, allowing missing dependencies to disable features without causing build failures on macOS. Additionally, it refines the search paths for the Sparkle framework and adjusts the linking of the discord-rpc library based on the availability of RapidJSON.
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
set(summary_willbuild "")
|
||||
set(summary_willnotbuild "")
|
||||
|
||||
# On some platforms (notably macOS via Homebrew), many "optional" dependencies are
|
||||
# not installed by default. Historically, Strawberry treated missing optional deps
|
||||
# as a hard error when the option defaulted to ON, which makes first-time builds
|
||||
# frustrating.
|
||||
#
|
||||
# This toggle controls that behavior:
|
||||
# - ON => missing optional deps abort the configure (packager/CI-friendly)
|
||||
# - OFF => missing optional deps auto-disable the component (dev-friendly)
|
||||
set(_optional_components_fatal_default ON)
|
||||
if(APPLE)
|
||||
set(_optional_components_fatal_default OFF)
|
||||
endif()
|
||||
option(OPTIONAL_COMPONENTS_MISSING_DEPS_ARE_FATAL
|
||||
"If ON, missing optional component dependencies are fatal (otherwise components auto-disable)"
|
||||
${_optional_components_fatal_default}
|
||||
)
|
||||
|
||||
macro(optional_component_summary_add name test)
|
||||
if (${test})
|
||||
list(APPEND summary_willbuild ${name})
|
||||
@@ -80,8 +97,13 @@ function(optional_component name default description)
|
||||
set(text "${description} (missing ${deplist_text})")
|
||||
|
||||
set(summary_willnotbuild "${summary_willnotbuild};${text}" PARENT_SCOPE)
|
||||
|
||||
message(FATAL_ERROR "${text}, to disable this optional feature, pass -D${option_variable}=OFF to CMake")
|
||||
if(OPTIONAL_COMPONENTS_MISSING_DEPS_ARE_FATAL)
|
||||
message(FATAL_ERROR "${text}, to disable this optional feature, pass -D${option_variable}=OFF to CMake")
|
||||
else()
|
||||
message(STATUS "${text} - disabling ${option_variable}")
|
||||
set(${option_variable} OFF CACHE BOOL "${description}" FORCE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
else()
|
||||
set(${have_variable} ON PARENT_SCOPE)
|
||||
|
||||
Reference in New Issue
Block a user