From: Nicholas Guriev Date: Fri, 27 Sep 2019 18:28:05 +0000 (+0300) Subject: Introduce export map to completely hide private symbols X-Git-Tag: submit/tizen/20191001.213324~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba64b938b2481408c9cc77afff6e67b72f4b5ba3;p=platform%2Fcore%2Fuifw%2Flottie-player.git Introduce export map to completely hide private symbols Also put configureModelCacheSize into the rlottie namespace. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e0d4e0b..74a7536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,13 @@ target_link_libraries(rlottie "${CMAKE_THREAD_LIBS_INIT}" ) +if (NOT APPLE AND NOT WIN32) + target_link_libraries(rlottie + PRIVATE + "-Wl,--version-script=${CMAKE_SOURCE_DIR}/rlottie.expmap" + ) +endif() + if (LOTTIE_MODULE) # for dlopen, dlsym and dlclose dependancy target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS}) diff --git a/rlottie.expmap b/rlottie.expmap new file mode 100644 index 0000000..cfc3828 --- /dev/null +++ b/rlottie.expmap @@ -0,0 +1,8 @@ +/* This version script for ld exposes only (r)lottie namespace. */ +{ +global: + lottie_*; + extern "C++" { rlottie::* }; +local: + *; +}; diff --git a/src/lottie/lottieanimation.cpp b/src/lottie/lottieanimation.cpp index be4d93e..caf546d 100644 --- a/src/lottie/lottieanimation.cpp +++ b/src/lottie/lottieanimation.cpp @@ -25,7 +25,7 @@ using namespace rlottie; -LOT_EXPORT void configureModelCacheSize(size_t cacheSize) +LOT_EXPORT void rlottie::configureModelCacheSize(size_t cacheSize) { LottieLoader::configureModelCacheSize(cacheSize); } diff --git a/src/meson.build b/src/meson.build index 3bcd609..da62e2d 100644 --- a/src/meson.build +++ b/src/meson.build @@ -7,6 +7,11 @@ if (cc.get_id() != 'msvc') '-Woverloaded-virtual', '-Wno-unused-parameter'] endif +linker_flags = [] +if (host_machine.system() not in ['darwin', 'windows']) + linker_flags += ['-Wl,--version-script=@0@/../rlottie.expmap'.format(meson.current_source_dir())] +endif + subdir('vector') subdir('lottie') subdir('binding') @@ -19,6 +24,7 @@ rlottie_lib = library('rlottie', dependencies : rlottie_lib_dep, install : true, cpp_args : compiler_flags, + link_args : linker_flags, gnu_symbol_visibility : 'hidden', )