Merge branch 'gitee-master' into gitlab-upstream

This commit is contained in:
zhengshuxin 2024-04-02 18:41:58 +08:00
commit e566fe0e58
8 changed files with 143 additions and 15 deletions

View File

@ -82,16 +82,18 @@ endif()
add_subdirectory(lib_acl acl)
add_subdirectory(lib_protocol protocol)
add_subdirectory(lib_acl_cpp acl_cpp)
if (ACL_BUILD_SHARED MATCHES "YES")
add_dependencies(protocol acl)
add_dependencies(acl_cpp protocol acl)
add_dependencies(protocol_shared acl_shared)
add_dependencies(acl_cpp_shared protocol_shared acl_shared)
endif()
#if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android")
#if (CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
add_subdirectory(lib_fiber/c fiber)
add_subdirectory(lib_fiber/cpp fiber_cpp)
if (ACL_BUILD_SHARED MATCHES "YES")
add_dependencies(fiber_cpp acl_cpp protocol acl fiber)
add_dependencies(fiber_cpp_shared acl_cpp_shared protocol_shared acl_shared fiber_shared)
endif()
#endif()

View File

@ -98,6 +98,8 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<excludeFolder url="file://$MODULE_DIR$/.cxx" />
<excludeFolder url="file://$MODULE_DIR$/.externalNativeBuild" />
<excludeFolder url="file://$MODULE_DIR$/.gradle" />

View File

@ -58,7 +58,7 @@ android {
cmake {
//arguments '-DANDROID_PLATFORM=android-14','-DANDROID_TOOLCHAIN=clang'
//targets 'acl_static', 'protocol_static', 'acl_cpp_static', 'fiber_static', 'fiber_cpp_static' // for ndk12b, ndk16b
targets 'acl_static', 'protocol_static', 'acl_cpp_static', 'fiber_static', 'fiber_cpp_static', 'acl', 'protocol', 'acl_cpp', 'fiber', 'fiber_cpp' // for ndk20 or above
targets 'acl_static', 'protocol_static', 'acl_cpp_static', 'fiber_static', 'fiber_cpp_static', 'acl_shared', 'protocol_shared', 'acl_cpp_shared', 'fiber_shared', 'fiber_cpp_shared' // for ndk20 or above
}
}
}

View File

@ -191,6 +191,21 @@ endif()
link_directories(${lib_output_path})
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS acl_static
EXPORT acl_static-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if (CMAKE_INSTALL_INCLUDEDIR MATCHES "")
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/acl-lib/acl/"
)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED MATCHES "YES")
if (CMAKE_SYSTEM_NAME MATCHES "Android")
if (ANDROID_STL MATCHES "gnustl_shared")
@ -208,7 +223,21 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${sys_ldflags}")
add_library(acl SHARED ${lib_src})
add_library(acl_shared SHARED ${lib_src})
if (${WIN_OS})
SET_TARGET_PROPERTIES(acl_shared PROPERTIES OUTPUT_NAME "libacl")
else()
SET_TARGET_PROPERTIES(acl_shared PROPERTIES OUTPUT_NAME "acl")
endif()
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS acl_shared
EXPORT acl_shared-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()
##############################################################################

View File

@ -253,6 +253,21 @@ endif()
link_directories(${lib_output_path})
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS acl_cpp_static
EXPORT acl_cpp_static-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if (CMAKE_INSTALL_INCLUDEDIR MATCHES "")
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/acl_cpp/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/acl-lib/acl_cpp/"
)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED MATCHES "YES")
if (CMAKE_SYSTEM_NAME MATCHES "Android")
if (ANDROID_STL MATCHES "gnustl_shared")
@ -279,12 +294,21 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED
if (ACL_BUILD_SHARED_ONE MATCHES "YES")
set(lc_flags "${lib_output_path}/libprotocol.a ${lib_output_path}/libacl.a")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_flags} ${sys_ldflags}")
add_library(acl_cpp SHARED ${lib_src})
add_library(acl_cpp_shared SHARED ${lib_src})
else()
set(lc_flags "-Wl,-rpath,. -L${lib_output_path} -lprotocol -lacl")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_flags} ${sys_ldflags}")
add_library(acl_cpp SHARED ${lib_src})
target_link_libraries(acl_cpp protocol acl)
add_library(acl_cpp_shared SHARED ${lib_src})
target_link_libraries(acl_cpp_shared protocol acl)
endif()
SET_TARGET_PROPERTIES(acl_cpp_shared PROPERTIES OUTPUT_NAME "acl_cpp")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS acl_cpp_shared
EXPORT acl_cpp_shared-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()

View File

@ -153,6 +153,21 @@ endif()
link_directories(${lib_output_path})
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS fiber_static
EXPORT fiber_static-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if (CMAKE_INSTALL_INCLUDEDIR MATCHES "")
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/fiber/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/acl-lib/fiber"
)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED MATCHES "YES")
if (CMAKE_SYSTEM_NAME MATCHES "Android")
if (ANDROID_STL MATCHES "gnustl_shared")
@ -167,7 +182,15 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED
endif()
set(CMAKE_SHARED_LINKER_FLAGS "${sys_ldflags}")
add_library(fiber SHARED ${lib_src})
add_library(fiber_shared SHARED ${lib_src})
SET_TARGET_PROPERTIES(fiber_shared PROPERTIES OUTPUT_NAME "fiber")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS fiber_shared
EXPORT fiber_shared-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()
##############################################################################

View File

@ -139,6 +139,21 @@ endif()
link_directories(${lib_output_path})
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS fiber_cpp_static
EXPORT fiber_cpp_static-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if (CMAKE_INSTALL_INCLUDEDIR MATCHES "")
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/fiber/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/acl-lib/fiber_cpp"
)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED MATCHES "YES")
if (CMAKE_SYSTEM_NAME MATCHES "Android")
if (ANDROID_STL MATCHES "gnustl_shared")
@ -161,12 +176,21 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED
if (ACL_BUILD_SHARED_ONE MATCHES "YES")
set(lc_ldflags "${lib_output_path}/libacl_cpp.a ${lib_output_path}/libprotocol.a ${lib_output_path}/libacl.a ${lib_output_path}/libfiber.a")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_ldflags} ${sys_ldflags}")
add_library(fiber_cpp SHARED ${lib_src})
add_library(fiber_cpp_shared SHARED ${lib_src})
else()
set(lc_ldflags "-Wl,-rpath,. -L${lib_output_path} -lacl_cpp -lprotocol -lacl -lfiber")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_ldflags} ${sys_ldflags}")
add_library(fiber_cpp SHARED ${lib_src})
target_link_libraries(fiber_cpp acl_cpp protocol acl fiber)
add_library(fiber_cpp_shared SHARED ${lib_src})
target_link_libraries(fiber_cpp_shared acl_cpp protocol acl fiber)
endif()
SET_TARGET_PROPERTIES(fiber_cpp_shared PROPERTIES OUTPUT_NAME "fiber_cpp")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS fiber_cpp_shared
EXPORT fiber_cpp_shared-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()

View File

@ -139,6 +139,21 @@ endif()
link_directories(${lib_output_path})
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS protocol_static
EXPORT protocol_static-targets
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
if (CMAKE_INSTALL_INCLUDEDIR MATCHES "")
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/include)
endif()
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/acl-lib/protocol/"
)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED MATCHES "YES")
if (CMAKE_SYSTEM_NAME MATCHES "Android")
if (ANDROID_STL MATCHES "gnustl_shared")
@ -158,12 +173,21 @@ if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR AND ACL_BUILD_SHARED
if (ACL_BUILD_SHARED_ONE MATCHES "YES")
set(lc_flags "${lib_output_path}/libacl.a")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_flags} ${sys_ldflags}")
add_library(protocol SHARED ${lib_src})
add_library(protocol_shared SHARED ${lib_src})
else()
set(lc_flags "-Wl,-rpath,. -L${lib_output_path} -lacl")
set(CMAKE_SHARED_LINKER_FLAGS "${lc_flags} ${sys_ldflags}")
add_library(protocol SHARED ${lib_src})
target_link_libraries(protocol acl)
add_library(protocol_shared SHARED ${lib_src})
target_link_libraries(protocol_shared acl)
endif()
SET_TARGET_PROPERTIES(protocol_shared PROPERTIES OUTPUT_NAME "protocol")
if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
install(TARGETS protocol_shared
EXPORT protocol_shared-targets
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
)
endif()
endif()