From db7ab5d73e748f86ee00e31965265969c0c7060f Mon Sep 17 00:00:00 2001 From: Roxie Linden Date: Sat, 9 Sep 2023 22:19:22 -0700 Subject: Updates to build on mac. --- indra/llwebrtc/CMakeLists.txt | 34 ++++++++++++++++++++-------------- indra/llwebrtc/llwebrtc_impl.h | 11 ++++++++++- 2 files changed, 30 insertions(+), 15 deletions(-) (limited to 'indra/llwebrtc') diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt index 881a3af607..fde4b87a3e 100644 --- a/indra/llwebrtc/CMakeLists.txt +++ b/indra/llwebrtc/CMakeLists.txt @@ -13,11 +13,6 @@ include(WebRTC) project(llwebrtc) -message(STATUS "C Compiler executable: ${CMAKE_C_COMPILER}") -message(STATUS "CXX Compiler executable: ${CMAKE_CXX_COMPILER}") -message(STATUS "Linker executable: ${CMAKE_LINKER}") -message(STATUS "SharedLib: ${SHARED_LIB_STAGING_DIR}") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++ -lc++abi") @@ -34,10 +29,11 @@ set(llwebrtc_HEADER_FILES list(APPEND llwebrtc_SOURCE_FILES ${llwebrtc_HEADER_FILES}) add_library (llwebrtc SHARED ${llwebrtc_SOURCE_FILES}) - + set_target_properties(llwebrtc PROPERTIES PUBLIC_HEADER llwebrtc.h) -target_link_libraries(llwebrtc PRIVATE ll::webrtc +if (WINDOWS) + target_link_libraries(llwebrtc PRIVATE ll::webrtc secur32 winmm dmoguids @@ -45,13 +41,23 @@ target_link_libraries(llwebrtc PRIVATE ll::webrtc msdmo strmiids iphlpapi) -target_include_directories( llwebrtc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) - -set_property(TARGET llwebrtc PROPERTY - MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") - -install(TARGETS llwebrtc RUNTIME DESTINATION "${CMAKE_BINARY_DIR}/sharedlibs/RelWithDebInfo") - +elseif (DARWIN) + target_link_libraries(llwebrtc PRIVATE ll::webrtc) +elseif (LINUX) + target_link_libraries(llwebrtc PRIVATE ll::webrtc) +endif (WINDOWS) + +target_include_directories( llwebrtc INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) + +if (WINDOWS) + set_property(TARGET llwebrtc PROPERTY + MSVC_RUNTIME_LIBRARY "MultiThreadedDebug") +endif (WINDOWS) + +ADD_CUSTOM_COMMAND(TARGET llwebrtc POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + $ + ${SHARED_LIB_STAGING_DIR}) # Add tests if (LL_TESTS) endif (LL_TESTS) diff --git a/indra/llwebrtc/llwebrtc_impl.h b/indra/llwebrtc/llwebrtc_impl.h index 10916e5a25..07c0f514b2 100644 --- a/indra/llwebrtc/llwebrtc_impl.h +++ b/indra/llwebrtc/llwebrtc_impl.h @@ -28,12 +28,21 @@ #define LLWEBRTC_IMPL_H #define LL_MAKEDLL +#if defined(_WIN32) || defined(_WIN64) #define WEBRTC_WIN 1 +#elif defined(__APPLE__) +#define WEBRTC_MAC 1 +#define WEBRTC_POSIX 1 +#elif __linux__ +#define WEBRTC_LINUX 1 +#endif + #include "llwebrtc.h" // WebRTC Includes #ifdef WEBRTC_WIN #pragma warning(disable : 4996) #endif // WEBRTC_WIN + #include "api/scoped_refptr.h" #include "rtc_base/ref_count.h" #include "rtc_base/ref_counted_object.h" @@ -174,4 +183,4 @@ class LLWebRTCImpl : public LLWebRTCDeviceInterface, } -#endif // LLWEBRTC_IMPL_H \ No newline at end of file +#endif // LLWEBRTC_IMPL_H -- cgit v1.2.3