Skip to content

Commit f85f30a

Browse files
authored
Apple frameworks: match CoreFoundation and CFNetwork linkage (#2317)
* Apple frameworks: match linkage with CoreFoundation and CFNetwork with actual code * Fix appleframeworks in Meson code
1 parent 6da7f0c commit f85f30a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,9 +278,9 @@ target_link_libraries(${PROJECT_NAME} ${_INTERFACE_OR_PUBLIC}
278278
$<$<PLATFORM_ID:Windows>:ws2_32>
279279
$<$<PLATFORM_ID:Windows>:crypt32>
280280
# Needed for API from MacOS Security framework
281-
"$<$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>,$<BOOL:${HTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN}>>:-framework CoreFoundation -framework Security>"
281+
"$<$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${HTTPLIB_IS_USING_OPENSSL}>,$<BOOL:${HTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN}>>:-framework CFNetwork -framework CoreFoundation -framework Security>"
282282
# Needed for non-blocking getaddrinfo on MacOS
283-
"$<$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${HTTPLIB_USE_NON_BLOCKING_GETADDRINFO}>>:-framework CFNetwork>"
283+
"$<$<AND:$<PLATFORM_ID:Darwin>,$<BOOL:${HTTPLIB_USE_NON_BLOCKING_GETADDRINFO}>>:-framework CFNetwork -framework CoreFoundation>"
284284
# Can't put multiple targets in a single generator expression or it bugs out.
285285
$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::common>
286286
$<$<BOOL:${HTTPLIB_IS_USING_BROTLI}>:Brotli::encoder>

meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if openssl_dep.found()
4444
deps += openssl_dep
4545
args += '-DCPPHTTPLIB_OPENSSL_SUPPORT'
4646
if host_machine.system() == 'darwin'
47-
macosx_keychain_dep = dependency('appleframeworks', modules: ['CoreFoundation', 'Security'], required: get_option('macosx_keychain'))
47+
macosx_keychain_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation', 'Security'], required: get_option('macosx_keychain'))
4848
if macosx_keychain_dep.found()
4949
deps += macosx_keychain_dep
5050
args += '-DCPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN'
@@ -85,7 +85,7 @@ async_ns_opt = get_option('non_blocking_getaddrinfo')
8585
if host_machine.system() == 'windows'
8686
async_ns_dep = cxx.find_library('ws2_32', required: async_ns_opt)
8787
elif host_machine.system() == 'darwin'
88-
async_ns_dep = dependency('appleframeworks', modules: ['CFNetwork'], required: async_ns_opt)
88+
async_ns_dep = dependency('appleframeworks', modules: ['CFNetwork', 'CoreFoundation'], required: async_ns_opt)
8989
else
9090
async_ns_dep = cxx.find_library('anl', required: async_ns_opt)
9191
endif

0 commit comments

Comments
 (0)