diff options
author | Nicky <nicky.dasmijn@gmail.com> | 2022-04-16 15:29:02 +0200 |
---|---|---|
committer | Nicky <nicky.dasmijn@gmail.com> | 2022-04-16 15:29:02 +0200 |
commit | bb85651d987a6cb969de7dd7c2b130411de6203c (patch) | |
tree | d143b3b23331469170515726baa8a76af60135dd /indra/cmake | |
parent | c8eb53859fb9b9f59d5ce8ef67f4011e95e34a9a (diff) |
Create a new target ll::oslibrary to link against libs specific to the OS compiled on.
This gets rid of the a few OS specific set and uses variables (which some even seemed mostly
duplicate like WINDOWS_LIBRARIES ans UI_LIBRARIES) and it also solves the problem of
having them to tack on every target, as of no they come as a transitive dependency from llcommon
Diffstat (limited to 'indra/cmake')
-rw-r--r-- | indra/cmake/LLAddBuildTest.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/Linking.cmake | 70 |
2 files changed, 44 insertions, 28 deletions
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index a3c873b389..9412475640 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -46,8 +46,6 @@ INCLUDE(GoogleMock) SET(alltest_LIBRARIES llcommon ll::googlemock - ${PTHREAD_LIBRARY} - ${WINDOWS_LIBRARIES} ) IF(NOT "${project}" STREQUAL "llmath") # add llmath as a dep unless the tested module *is* llmath! diff --git a/indra/cmake/Linking.cmake b/indra/cmake/Linking.cmake index 4a57a6a3ef..ccbb27ca42 100644 --- a/indra/cmake/Linking.cmake +++ b/indra/cmake/Linking.cmake @@ -55,32 +55,50 @@ endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release") link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS}) +create_target(ll::oslibraries) + if (LINUX) - set(DL_LIBRARY dl) - set(PTHREAD_LIBRARY pthread) -else (LINUX) - set(DL_LIBRARY "") - set(PTHREAD_LIBRARY "") -endif (LINUX) + set_target_libraries( ll::oslibraries + dl + pthread + rt) +elseif (WINDOWS) + set_target_libraries( ll::oslibraries + advapi32 + shell32 + ws2_32 + mswsock + psapi + winmm + netapi32 + wldap32 + gdi32 + user32 + ole32 + dbghelp + legacy_stdio_definitions + ) +else() + include(CMakeFindFrameworks) + find_library(COREFOUNDATION_LIBRARY CoreFoundation) + find_library(CARBON_LIBRARY Carbon) + find_library(COCOA_LIBRARY Cocoa) + find_library(IOKIT_LIBRARY IOKit) + + find_library(AGL_LIBRARY AGL) + find_library(APPKIT_LIBRARY AppKit) + find_library(COREAUDIO_LIBRARY CoreAudio) + + set_target_libraries( ll::oslibraries + ${COCOA_LIBRARY} + ${IOKIT_LIBRARY} + ${COREFOUNDATION_LIBRARY} + ${CARBON_LIBRARY} + ${AGL_LIBRARY} + ${APPKITT_LIBRARY} + ${COREAUDIO_LIBRARY} + ) +endif() + -if (WINDOWS) - set(WINDOWS_LIBRARIES - advapi32 - shell32 - ws2_32 - mswsock - psapi - winmm - netapi32 - wldap32 - gdi32 - user32 - ole32 - dbghelp - ) -else (WINDOWS) - set(WINDOWS_LIBRARIES "") -endif (WINDOWS) - -mark_as_advanced(DL_LIBRARY PTHREAD_LIBRARY WINDOWS_LIBRARIES) |