mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue