1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

CMake: Link CoreServices weakly when building for iOS 11 or lower

This commit is contained in:
reuk 2021-04-21 11:15:26 +01:00
parent b5c0c75a5b
commit cb399a57ff
No known key found for this signature in database
GPG key ID: 9ADCD339CFC98A11

View file

@ -482,7 +482,14 @@ function(_juce_link_frameworks target visibility)
find_library("juce_found_${framework}" "${framework}" REQUIRED)
target_link_libraries("${target}" "${visibility}" "${juce_found_${framework}}")
elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
target_link_libraries("${target}" "${visibility}" "-framework ${framework}")
# CoreServices is only available on iOS 12+, we must link it weakly on earlier platforms
if((framework STREQUAL "CoreServices") AND (CMAKE_OSX_DEPLOYMENT_TARGET LESS 12.0))
set(framework_flags "-weak_framework ${framework}")
else()
set(framework_flags "-framework ${framework}")
endif()
target_link_libraries("${target}" "${visibility}" "${framework_flags}")
endif()
endforeach()
endfunction()