optimize compiling options

This commit is contained in:
shuxin   zheng 2019-09-30 15:05:20 +08:00
parent 60f98235cd
commit f66472cadf
2 changed files with 2 additions and 3 deletions

View File

@ -192,8 +192,6 @@ if (ACL_CLIENT_ONLY MATCHES "YES")
endif()
if (CMAKE_SYSTEM_NAME MATCHES "Android")
set(CMAKE_SHARED_LINKER_FLAGS "-shared -lz -flto")
set(lib_output_path ${CMAKE_CURRENT_SOURCE_DIR}/../android/lib/${ANDROID_ABI})
else()
set(lib_output_path ${PROJECT_BINARY_DIR}/lib)
@ -207,6 +205,7 @@ SET_TARGET_PROPERTIES(acl_cpp_static PROPERTIES OUTPUT_NAME "acl_cpp")
link_directories(${lib_output_path})
if (${UNIX_OS})
set(CMAKE_SHARED_LINKER_FLAGS "-shared -lz -flto")
target_compile_options(acl_cpp_static PRIVATE
-fvisibility=hidden
-fvisibility-inlines-hidden)

View File

@ -117,7 +117,7 @@ link_directories(${lib_output_path})
if (${UNIX_OS})
set(CMAKE_SHARED_LINKER_FLAGS "-shared -flto")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,-rpath,. -L${lib_output_path} -lacl")
set(CMAKE_SHARED_LINKER_FLAGS "${lib_output_path}/libacl.a")
target_compile_options(protocol_static PRIVATE
-fvisibility=hidden
-fvisibility-inlines-hidden)