summaryrefslogtreecommitdiff
path: root/indra/llwebrtc/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llwebrtc/CMakeLists.txt')
-rw-r--r--indra/llwebrtc/CMakeLists.txt87
1 files changed, 87 insertions, 0 deletions
diff --git a/indra/llwebrtc/CMakeLists.txt b/indra/llwebrtc/CMakeLists.txt
new file mode 100644
index 0000000000..d6217ff3a4
--- /dev/null
+++ b/indra/llwebrtc/CMakeLists.txt
@@ -0,0 +1,87 @@
+# -*- cmake -*-
+
+# some webrtc headers require C++ 20
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+include(00-Common)
+include(Linking)
+include(WebRTC)
+
+project(llwebrtc)
+
+if (LINUX)
+ add_compile_options(-Wno-deprecated-declarations) # webrtc::CreateAudioDeviceWithDataObserver is deprecated
+endif (LINUX)
+
+set(llwebrtc_SOURCE_FILES
+ llwebrtc.cpp
+ )
+
+set(llwebrtc_HEADER_FILES
+ CMakeLists.txt
+ llwebrtc.h
+ llwebrtc_impl.h
+ )
+
+list(APPEND llwebrtc_SOURCE_FILES ${llwebrtc_HEADER_FILES})
+
+add_library (llwebrtc SHARED ${llwebrtc_SOURCE_FILES})
+
+if (NOT INSTALL)
+set_target_properties(llwebrtc PROPERTIES PUBLIC_HEADER llwebrtc.h)
+endif ()
+
+if (WINDOWS)
+ set_target_properties(llwebrtc
+ PROPERTIES
+ LINK_FLAGS "/debug /LARGEADDRESSAWARE"
+ )
+ target_link_libraries(llwebrtc PRIVATE ll::webrtc
+ secur32
+ winmm
+ dmoguids
+ wmcodecdspuuid
+ msdmo
+ strmiids
+ iphlpapi)
+ if (USE_BUGSPLAT)
+ set_target_properties(llwebrtc PROPERTIES PDB_OUTPUT_DIRECTORY "${SYMBOLS_STAGING_DIR}")
+ endif (USE_BUGSPLAT)
+elseif (DARWIN)
+ target_link_libraries(llwebrtc PRIVATE ll::webrtc)
+ if (USE_BUGSPLAT)
+ set_target_properties(llwebrtc PROPERTIES XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym"
+ XCODE_ATTRIBUTE_DWARF_DSYM_FOLDER_PATH "${SYMBOLS_STAGING_DIR}/dSYMs")
+ endif (USE_BUGSPLAT)
+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
+ $<TARGET_FILE:llwebrtc>
+ ${SHARED_LIB_STAGING_DIR})
+# Add tests
+if (LL_TESTS)
+endif (LL_TESTS)
+
+if (INSTALL)
+ if (DARWIN)
+ set(_LIB ../Frameworks)
+ elseif (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu)
+ set(_LIB lib/${ARCH}-linux-gnu)
+ elseif (EXISTS /lib64)
+ set(_LIB lib64)
+ else (DARWIN)
+ set(_LIB lib)
+ endif (DARWIN)
+ install(TARGETS ${PROJECT_NAME} DESTINATION ${_LIB})
+endif (INSTALL)