[cmake] Propagate Cocoa backend frameworks to consumers of static raylib on macOS
Bundled GLFW links '-framework Cocoa/IOKit/QuartzCore' privately, and the static-install export block removes glfw from the exported dependencies. As a result the installed CMake package only carried OpenGL.framework, and linking any consumer of libraylib.a failed with undefined Objective-C symbols (_objc_retain etc.). Append the three frameworks to the static install interface when the bundled GLFW is used, so installed consumers get a complete link line.
This commit is contained in:
parent
60b8b3ccde
commit
7d8f356699
1 changed files with 13 additions and 0 deletions
|
|
@ -114,6 +114,19 @@ if (NOT BUILD_SHARED_LIBS)
|
|||
|
||||
if (NOT glfw3_FOUND)
|
||||
list(REMOVE_ITEM raylib_install_private_libs glfw)
|
||||
|
||||
# Bundled GLFW links its Cocoa backend frameworks privately, so they
|
||||
# must be propagated to consumers of the static library, whose final
|
||||
# link line would otherwise miss them.
|
||||
if (APPLE)
|
||||
find_library(COCOA_FRAMEWORK Cocoa)
|
||||
find_library(IOKIT_FRAMEWORK IOKit)
|
||||
find_library(QUARTZCORE_FRAMEWORK QuartzCore)
|
||||
list(APPEND raylib_install_private_libs
|
||||
${COCOA_FRAMEWORK}
|
||||
${IOKIT_FRAMEWORK}
|
||||
${QUARTZCORE_FRAMEWORK})
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
foreach(lib IN LISTS raylib_install_private_libs)
|
||||
|
|
|
|||
Loading…
Reference in a new issue