mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
Linux: CMake: Omit linking browser related dynamic libraries
We've already had a mechanism in place which loads these libraries, such as libwebkit2gtk-4.1.so, only if they are available on the system during runtime. This way we can run with either version 4.1 or 4.0 of the library depending on which one is available. It's also possible to run apps on headless systems with the relevant features being effectively disabled in such situations.
This commit is contained in:
parent
11403080ba
commit
2d6bb5ba0e
2 changed files with 11 additions and 3 deletions
|
|
@ -376,12 +376,15 @@ endfunction()
|
|||
# ==================================================================================================
|
||||
|
||||
function(_juce_create_pkgconfig_target name)
|
||||
set(options NOLINK)
|
||||
cmake_parse_arguments(JUCE_ARG "${options}" "" "" ${ARGN})
|
||||
|
||||
if(TARGET juce::pkgconfig_${name})
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(${name} ${ARGN})
|
||||
pkg_check_modules(${name} ${JUCE_ARG_UNPARSED_ARGUMENTS})
|
||||
|
||||
add_library(pkgconfig_${name} INTERFACE)
|
||||
add_library(juce::pkgconfig_${name} ALIAS pkgconfig_${name})
|
||||
|
|
@ -389,10 +392,13 @@ function(_juce_create_pkgconfig_target name)
|
|||
|
||||
set(pairs
|
||||
"INCLUDE_DIRECTORIES\;INCLUDE_DIRS"
|
||||
"LINK_LIBRARIES\;LINK_LIBRARIES"
|
||||
"LINK_OPTIONS\;LDFLAGS_OTHER"
|
||||
"COMPILE_OPTIONS\;CFLAGS_OTHER")
|
||||
|
||||
if(NOT JUCE_ARG_NOLINK)
|
||||
list(APPEND pairs "LINK_LIBRARIES\;LINK_LIBRARIES")
|
||||
endif()
|
||||
|
||||
foreach(pair IN LISTS pairs)
|
||||
list(GET pair 0 key)
|
||||
list(GET pair 1 value)
|
||||
|
|
|
|||
|
|
@ -107,7 +107,9 @@ endfunction()
|
|||
if((CMAKE_SYSTEM_NAME STREQUAL "Linux") OR (CMAKE_SYSTEM_NAME MATCHES ".*BSD"))
|
||||
_juce_create_pkgconfig_target(JUCE_CURL_LINUX_DEPS libcurl)
|
||||
_juce_available_pkgconfig_module_or_else(webkit_package_name webkit2gtk-4.1 webkit2gtk-4.0)
|
||||
_juce_create_pkgconfig_target(JUCE_BROWSER_LINUX_DEPS ${webkit_package_name} gtk+-x11-3.0)
|
||||
|
||||
# All browser related libs are loaded dynamically only if they are available during runtime
|
||||
_juce_create_pkgconfig_target(JUCE_BROWSER_LINUX_DEPS NOLINK ${webkit_package_name} gtk+-x11-3.0)
|
||||
endif()
|
||||
|
||||
# We set up default/fallback copy dirs here. If you need different copy dirs, use
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue