only export olm functions to avoid colliding with other libraries

This commit is contained in:
Hubert Chathi 2021-06-16 15:05:19 -04:00
parent d47c2a92b8
commit 1b7973626e
2 changed files with 8 additions and 0 deletions

View file

@ -48,6 +48,10 @@ add_library(olm
lib/curve25519-donna/curve25519-donna.c)
add_library(Olm::Olm ALIAS olm)
# restrict the exported symbols
set(CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libolm.version)
set_target_properties(olm PROPERTIES LINK_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/libolm.version)
target_include_directories(olm
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>

4
libolm.version Normal file
View file

@ -0,0 +1,4 @@
{
global: olm*; _olm*; megolm*; _ZN3olm*;
local: *;
};