Skip to content

Commit

Permalink
Configure datachannel target_properties for APPLE
Browse files Browse the repository at this point in the history
After 7591b96 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] obsproject/obs-deps#204 (comment)
  • Loading branch information
Sean-Der committed Jan 11, 2024
1 parent 143a44d commit d10d73e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d10d73e

Please sign in to comment.