build shared acl can be set from cmake args

This commit is contained in:
shuxin   zheng 2019-10-17 16:58:44 +08:00
parent 6aeeb6dc8c
commit 2998681abc
6 changed files with 19 additions and 10 deletions

View File

@ -78,9 +78,11 @@ endif()
add_subdirectory(lib_acl acl)
add_subdirectory(lib_protocol protocol)
add_dependencies(protocol acl)
add_subdirectory(lib_acl_cpp acl_cpp)
add_dependencies(acl_cpp protocol acl)
if (ACL_BUILD_SHARED MATCHES "YES")
add_dependencies(protocol acl)
add_dependencies(acl_cpp protocol acl)
endif()
#if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
if (CMAKE_SYSTEM_NAME MATCHES "Linux")

View File

@ -15,11 +15,12 @@
cmake -DCMAKE_TOOLCHAIN_FILE=~/Library/Android/ndk-bundle-r20/build/cmake/android.toolchain.cmake \
-DANDROID_ABI="armeabi-v7a" \
-DANDROID_ARM_NEON=ON \
-DANDROID_PLATFORM=android-14 \
-DANDROID_PLATFORM=android-28 \
-DCMAKE_SYSTEM_NAME=Android \
-DACL_CLIENT_ONLY=YES \
-DDISABLE_DB=YES \
-DHAS_POLARSSL_DLL=NO \
-DCMAKE_BUILD_TYPE=RELEASE \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DACL_BUILD_SHARED=NO \
..

View File

@ -171,6 +171,8 @@ if (${UNIX_OS})
target_compile_options(acl_static PRIVATE -fvisibility=hidden)
endif()
add_library(acl SHARED ${lib_src})
if (ACL_BUILD_SHARED MATCHES "YES")
add_library(acl SHARED ${lib_src})
endif()
##############################################################################

View File

@ -227,8 +227,10 @@ elseif (${UNIX_OS})
endif()
if(NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_library(acl_cpp SHARED ${lib_src})
target_link_libraries(acl_cpp protocol acl)
if (ACL_BUILD_SHARED MATCHES "YES")
add_library(acl_cpp SHARED ${lib_src})
target_link_libraries(acl_cpp protocol acl)
endif()
endif()
##############################################################################

View File

@ -132,8 +132,10 @@ elseif (${UNIX_OS})
endif()
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
add_library(protocol SHARED ${lib_src})
target_link_libraries(protocol acl)
if (ACL_BUILD_SHARED MATCHES "YES")
add_library(protocol SHARED ${lib_src})
target_link_libraries(protocol acl)
endif()
endif()
##############################################################################

View File

@ -117,8 +117,8 @@ if not is_plat("windows") then
add_defines("acl_cpp_EXPORTS")
add_cflags("fno-addrsig")
add_cxxflags("fno-addrsig")
add_cflags("-MD", "-MT", "-MF")
add_cxxflags("-MD", "-MT", "-MF")
--add_cflags("-MD", "-MT", "-MF")
--add_cxxflags("-MD", "-MT", "-MF")
add_cflags("-no-canonical-prefixes")
add_cxxflags("-no-canonical-prefixes")
add_cflags("-fno-addrsig")