Skip to content

Commit 9a95a8b

Browse files
author
Alexander Widerberg
committed
Added Foundation as linking step. No clue why this even worked before...
1 parent 8504f26 commit 9a95a8b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

example/example-lib/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ else()
2424
message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}")
2525
endif()
2626

27+
find_library(FOUNDATION_LIBRARY Foundation)
28+
if (NOT FOUNDATION_LIBRARY)
29+
message(STATUS "Foundation.framework NOT found!")
30+
else()
31+
message(STATUS "Foundation.framework found! ${FOUNDATION_LIBRARY}")
32+
endif()
33+
2734
find_library(UIKIT_LIBRARY UIKit)
2835
if (NOT UIKIT_LIBRARY)
2936
message(STATUS "UIKit.framework NOT found!")
@@ -61,10 +68,12 @@ set(HEADERS
6168
# Library
6269
if(BUILD_SHARED)
6370
add_library (example SHARED ${SOURCES} ${HEADERS})
71+
target_link_libraries(example ${FOUNDATION_LIBRARY})
6472
target_compile_definitions(example PUBLIC IS_BUILDING_SHARED)
6573
message(STATUS "Building shared version...")
6674
else()
6775
add_library (example STATIC ${SOURCES} ${HEADERS})
76+
target_link_libraries(example ${FOUNDATION_LIBRARY})
6877
message(STATUS "Building static version...")
6978
endif()
7079

0 commit comments

Comments
 (0)