CMakeLists: Link in system framework libraries explicitly on macOS

Makes our libraries explicitly link in which libraries they need.
This makes our dependencies explicit and removes the reliance on the
LIBS variable to contain the libraries that they need.
This commit is contained in:
Lioncash
2018-03-30 15:43:49 -04:00
parent 7833f1a931
commit e93159e54a
5 changed files with 26 additions and 18 deletions

View File

@ -52,6 +52,15 @@ target_link_libraries(common PUBLIC
${VTUNE_LIBRARIES}
)
if (APPLE)
target_link_libraries(common
PRIVATE
${APPKIT_LIBRARY}
${COREFOUNDATION_LIBRARY}
${IOK_LIBRARY}
)
endif()
if(ANDROID)
target_sources(common PRIVATE
Logging/ConsoleListenerDroid.cpp

View File

@ -291,6 +291,15 @@ PUBLIC
z
)
if (APPLE)
target_link_libraries(core
PRIVATE
${CORESERV_LIBRARY}
${IOB_LIBRARY}
${IOK_LIBRARY}
)
endif()
if(LIBUSB_FOUND)
# Using shared LibUSB
target_link_libraries(core PUBLIC ${LIBUSB_LIBRARIES})

View File

@ -37,10 +37,6 @@ if(WIN32)
ControllerInterface/ForceFeedback/ForceFeedbackDevice.cpp
)
elseif(APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(CARBON_LIBRARY Carbon)
find_library(COCOA_LIBRARY Cocoa)
find_library(FORCEFEEDBACK_LIBRARY ForceFeedback)
target_sources(inputcommon PRIVATE
ControllerInterface/OSX/OSX.mm
ControllerInterface/OSX/OSXJoystick.mm
@ -53,6 +49,7 @@ elseif(APPLE)
${CARBON_LIBRARY}
${COCOA_LIBRARY}
${FORCEFEEDBACK_LIBRARY}
${IOK_LIBRARY}
)
elseif(X11_FOUND)
target_sources(inputcommon PRIVATE

View File

@ -9,9 +9,13 @@ add_library(uicommon
VideoUtils.cpp
)
target_link_libraries(uicommon PUBLIC
target_link_libraries(uicommon
PUBLIC
common
cpp-optparse
PRIVATE
$<$<BOOL:APPLE>:${IOK_LIBRARY}>
)
if(USE_X11)