From d10d73e4b819d5258b67edc7f5048e77a9181edf Mon Sep 17 00:00:00 2001 From: Sean DuBois Date: Thu, 11 Jan 2024 13:22:15 -0500 Subject: [PATCH] Configure datachannel target_properties for APPLE After 7591b9695c libdatachannel stopped working with OBS on macOS[0]. XCode only resolves one level of symlinks [1]. libdatachannel is generating two levels. This commit updates CMake to instead use ELF Headers instead of file names to communicate version of macOS. [0] https://stackoverflow.com/questions/29946961/xcode-copy-files-build-phase-and-symlinks [1] https://github.com/obsproject/obs-deps/pull/204#discussion_r1449200874 --- CMakeLists.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5760a4b7b..9dd556c18 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -257,11 +257,22 @@ add_library(datachannel SHARED ${LIBDATACHANNEL_HEADERS} ${LIBDATACHANNEL_IMPL_SOURCES} ${LIBDATACHANNEL_IMPL_HEADERS}) + set_target_properties(datachannel PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} CXX_STANDARD 17 CXX_VISIBILITY_PRESET default) + +if(APPLE) + set_target_properties(datachannel PROPERTIES + VERSION 0 + SOVERSION 0 + MACHO_COMPATIBILITY_VERSION 0 + MACHO_CURRENT_VERSION ${PROJECT_VERSION} + NO_SONAME TRUE) +endif() + target_compile_definitions(datachannel PRIVATE RTC_EXPORTS) add_library(datachannel-static STATIC EXCLUDE_FROM_ALL