Skip to content

Commit

Permalink
Add -ObjC flag to fix static linking on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
JonnyPtn authored and eXpl0it3r committed Oct 15, 2018
1 parent 43f57b2 commit 9fba1df
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/SFML/Window/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,11 @@ sfml_add_library(sfml-window
SOURCES ${SRC} ${PLATFORM_SRC})
target_link_libraries(sfml-window PUBLIC sfml-system)

# When static linking on macOS, we need to add this flag for objective C to work
if ((NOT BUILD_SHARED_LIBS) AND SFML_OS_MACOSX)
target_link_libraries(sfml-window PRIVATE -ObjC)
endif()

# find and setup usage for external libraries
if(SFML_OS_LINUX OR SFML_OS_FREEBSD OR SFML_OPENBSD)
sfml_find_package(X11 INCLUDE "X11_INCLUDE_DIR" LINK "X11_X11_LIB" "X11_Xrandr_LIB")
Expand Down

0 comments on commit 9fba1df

Please sign in to comment.