Configure CMake to allow build static rlottie lib

This commit is contained in:
Nicholas Guriev
2019-07-21 12:15:55 +03:00
committed by Subhransu
parent d07040d498
commit a1e46310f6
2 changed files with 16 additions and 6 deletions

View File

@@ -7,10 +7,14 @@ if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE MinSizeRel)
endif()
add_definitions(-DLOT_BUILD)
if (NOT DEFINED BUILD_SHARED_LIBS)
# Keep the previous behavior of the build system, consistent with Meson.
set(BUILD_SHARED_LIBS ON)
endif()
#declare target
add_library( rlottie SHARED "" )
add_library( rlottie )
set_target_properties( rlottie PROPERTIES DEFINE_SYMBOL LOT_BUILD )
#declare version of the target
set(player_version_major 0)
@@ -64,10 +68,10 @@ target_link_libraries(rlottie
"${CMAKE_THREAD_LIBS_INIT}"
)
# for dlopen, dlsym and dlclose dependancy
target_link_libraries(rlottie
PRIVATE
${CMAKE_DL_LIBS})
if (LOTTIE_MODULE)
# for dlopen, dlsym and dlclose dependancy
target_link_libraries(rlottie PRIVATE ${CMAKE_DL_LIBS})
endif()
if(APPLE)
target_link_libraries(rlottie

View File

@@ -2,6 +2,12 @@ if(LOTTIE_MODULE)
add_library(rlottie-image-loader SHARED
stb_image.cpp
)
target_compile_options(rlottie-image-loader PRIVATE
-fvisibility=hidden
)
set_target_properties(rlottie-image-loader PROPERTIES
DEFINE_SYMBOL LOT_BUILD
)
install(TARGETS rlottie-image-loader
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}