Commit 4b6e59a9 by Daniel Schürmann Committed by Copybara-Service

PR #1495: CMake: Link CoreFoundation with -framework

Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1495

This fixes https://github.com/abseil/abseil-cpp/issues/1494

With CMake 3.24 we can also use `$<LINK_LIBRARY:FRAMEWORK,CoreFoundation>`
but abseil is still at CMake 3.10

The change has been tested here: https://github.com/daschuer/vcpkg/actions/runs/5670741925

Merge f3ff6bc01ff45970d2b803ca51421483b423b72b into c9c0fd51

Merging this change closes #1495

COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1495 from daschuer:framework-link-fix f3ff6bc01ff45970d2b803ca51421483b423b72b
PiperOrigin-RevId: 552564485
Change-Id: I57b580e5795c54865576110e56220128d8b603b8
parent d3ddfaa1
...@@ -54,10 +54,6 @@ absl_cc_library( ...@@ -54,10 +54,6 @@ absl_cc_library(
${ABSL_DEFAULT_COPTS} ${ABSL_DEFAULT_COPTS}
) )
if(APPLE)
find_library(CoreFoundation CoreFoundation)
endif()
absl_cc_library( absl_cc_library(
NAME NAME
time_zone time_zone
...@@ -85,7 +81,9 @@ absl_cc_library( ...@@ -85,7 +81,9 @@ absl_cc_library(
${ABSL_DEFAULT_COPTS} ${ABSL_DEFAULT_COPTS}
DEPS DEPS
Threads::Threads Threads::Threads
$<$<PLATFORM_ID:Darwin>:${CoreFoundation}> # TODO(#1495): Use $<LINK_LIBRARY:FRAMEWORK,CoreFoundation> once our
# minimum CMake version >= 3.24
$<$<PLATFORM_ID:Darwin>:-Wl,-framework,CoreFoundation>
) )
# Internal-only target, do not depend on directly. # Internal-only target, do not depend on directly.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment