Skip to content

Commit 649ffdc

Browse files
committed
common : use find_library for CoreFoundation/Security
Signed-off-by: Adrien Gallouët <angt@huggingface.co>
1 parent 7bd65af commit 649ffdc

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

common/CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,11 @@ else()
109109
message(STATUS "OpenSSL found: ${OPENSSL_VERSION}")
110110
target_compile_definitions(${TARGET} PUBLIC CPPHTTPLIB_OPENSSL_SUPPORT)
111111
target_link_libraries(${TARGET} PUBLIC OpenSSL::SSL OpenSSL::Crypto)
112-
if (APPLE AND NOT IOS)
112+
if (APPLE)
113113
target_compile_definitions(${TARGET} PUBLIC CPPHTTPLIB_USE_CERTS_FROM_MACOSX_KEYCHAIN)
114-
target_link_libraries(${TARGET} PUBLIC "-framework CoreFoundation -framework Security")
114+
find_library(CORE_FOUNDATION_FRAMEWORK CoreFoundation REQUIRED)
115+
find_library(SECURITY_FRAMEWORK Security REQUIRED)
116+
target_link_libraries(${TARGET} PUBLIC ${CORE_FOUNDATION_FRAMEWORK} ${SECURITY_FRAMEWORK})
115117
endif()
116118
endif()
117119
else()

0 commit comments

Comments
 (0)