update
This commit is contained in:
@@ -35,6 +35,7 @@ set(third_party_ndk build/third-party-ndk)
|
|||||||
set(libfolly_DIR ${third_party_ndk}/folly/)
|
set(libfolly_DIR ${third_party_ndk}/folly/)
|
||||||
set(glog_DIR ${third_party_ndk}/glog)
|
set(glog_DIR ${third_party_ndk}/glog)
|
||||||
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
set(BOOST_DIR ${third_party_ndk}/boost/boost_1_63_0/)
|
||||||
|
set(LIBEVENT_DIR ${third_party_ndk}/LibEvent/libevent-1.0.0/include/)
|
||||||
|
|
||||||
|
|
||||||
set(build_DIR ${CMAKE_SOURCE_DIR}/build)
|
set(build_DIR ${CMAKE_SOURCE_DIR}/build)
|
||||||
@@ -58,6 +59,7 @@ target_include_directories(${PACKAGE_NAME} PRIVATE
|
|||||||
${glog_DIR}/glog-0.3.5/src/
|
${glog_DIR}/glog-0.3.5/src/
|
||||||
${BOOST_DIR}
|
${BOOST_DIR}
|
||||||
${BOOST_DIR}/../
|
${BOOST_DIR}/../
|
||||||
|
${LIBEVENT_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(${PACKAGE_NAME} fb sonarcpp)
|
target_link_libraries(${PACKAGE_NAME} fb sonarcpp)
|
||||||
|
|||||||
@@ -104,11 +104,28 @@ task prepareFolly(dependsOn: [downloadFolly], type: Copy) {
|
|||||||
into "$thirdPartyNdkDir/folly"
|
into "$thirdPartyNdkDir/folly"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task downloadLibEvent(dependsOn: [prepareFolly], type: Download) {
|
||||||
|
src 'https://github.com/libevent/libevent/archive/release-2.1.8-stable.tar.gz'
|
||||||
|
onlyIfNewer true
|
||||||
|
overwrite false
|
||||||
|
dest new File(downloadsDir, 'libevent-release-2.1.8-stable.tar.gz');
|
||||||
|
}
|
||||||
|
|
||||||
|
task prepareLibEvent(dependsOn: [downloadLibEvent], type: Copy) {
|
||||||
|
from tarTree(downloadLibEvent.dest)
|
||||||
|
from './third-party/LibEvent/'
|
||||||
|
include 'libevent-release-2.1.8-stable/**/*', 'build.gradle', 'CMakeLists.txt', 'ApplicationManifest.xml'
|
||||||
|
includeEmptyDirs = false
|
||||||
|
into "$thirdPartyNdkDir/LibEvent"
|
||||||
|
}
|
||||||
|
|
||||||
task prepareAllLibs() {
|
task prepareAllLibs() {
|
||||||
dependsOn finalizeGlog
|
dependsOn finalizeGlog
|
||||||
dependsOn prepareDoubleConversion
|
dependsOn prepareDoubleConversion
|
||||||
dependsOn prepareBoost
|
dependsOn prepareBoost
|
||||||
dependsOn prepareFolly
|
dependsOn prepareFolly
|
||||||
|
dependsOn downloadLibEvent
|
||||||
|
dependsOn prepareLibEvent
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
|||||||
26
android/third-party/Folly/CMakeLists.txt
vendored
26
android/third-party/Folly/CMakeLists.txt
vendored
@@ -15,14 +15,17 @@ list(APPEND dir_list ${FOLLY_DIR}/memory/detail)
|
|||||||
|
|
||||||
set(BOOST_DIR ../boost/boost_1_63_0/)
|
set(BOOST_DIR ../boost/boost_1_63_0/)
|
||||||
set(GLOG_DIR ../glog/)
|
set(GLOG_DIR ../glog/)
|
||||||
|
set(LIBEVENT_DIR ../LibEvent/libevent-1.0.0/include)
|
||||||
set(DOUBLECONVERSION_DIR ../double-conversion/double-conversion-3.0.0/)
|
set(DOUBLECONVERSION_DIR ../double-conversion/double-conversion-3.0.0/)
|
||||||
|
|
||||||
list(APPEND dir_list ${BOOST_DIR})
|
list(APPEND dir_list ${BOOST_DIR})
|
||||||
list(APPEND dir_list ${BOOST_DIR}/../)
|
list(APPEND dir_list ${BOOST_DIR}/../)
|
||||||
|
list(APPEND dir_list ${LIBEVENT_DIR}/)
|
||||||
|
|
||||||
include_directories(${dir_list})
|
include_directories(${dir_list})
|
||||||
|
|
||||||
add_compile_options(
|
add_compile_options(
|
||||||
|
-DFOLLY_HAVE_PTHREAD=1
|
||||||
-DFOLLY_NO_CONFIG=1
|
-DFOLLY_NO_CONFIG=1
|
||||||
-DFOLLY_HAVE_MEMRCHR
|
-DFOLLY_HAVE_MEMRCHR
|
||||||
-DFOLLY_MOBILE=1
|
-DFOLLY_MOBILE=1
|
||||||
@@ -41,6 +44,25 @@ add_compile_options(
|
|||||||
-Wno-tautological-constant-compare
|
-Wno-tautological-constant-compare
|
||||||
)
|
)
|
||||||
|
|
||||||
|
file(GLOB SRC_FILES ${FOLLY_DIR}/*.cpp
|
||||||
|
${FOLLY_DIR}/detail/*.cpp
|
||||||
|
${FOLLY_DIR}/hash/*.cpp
|
||||||
|
${FOLLY_DIR}/portability/*.cpp
|
||||||
|
${FOLLY_DIR}/io/async/*.cpp
|
||||||
|
${FOLLY_DIR}/io/async/ssl/*.cpp
|
||||||
|
${FOLLY_DIR}/io/*.cpp
|
||||||
|
${FOLLY_DIR}/synchronization/*.cpp
|
||||||
|
${FOLLY_DIR}/lang/*.cpp
|
||||||
|
${FOLLY_DIR}/memory/*.cpp
|
||||||
|
${FOLLY_DIR}/futures/*.cpp
|
||||||
|
${FOLLY_DIR}/futures/detail/*.cpp
|
||||||
|
${FOLLY_DIR}/experimental/hazptr/*.cpp
|
||||||
|
${FOLLY_DIR}/executors/*.cpp
|
||||||
|
${FOLLY_DIR}/concurrency/*.cpp
|
||||||
|
${FOLLY_DIR}/ssl/*.cpp
|
||||||
|
${FOLLY_DIR}/ssl/detail/*.cpp
|
||||||
|
${FOLLY_DIR}/system/*.cpp
|
||||||
|
)
|
||||||
list(APPEND SRC_FILES ${FOLLY_DIR}/Executor.cpp
|
list(APPEND SRC_FILES ${FOLLY_DIR}/Executor.cpp
|
||||||
${FOLLY_DIR}/lang/ColdClass.cpp
|
${FOLLY_DIR}/lang/ColdClass.cpp
|
||||||
${FOLLY_DIR}/lang/Assume.cpp
|
${FOLLY_DIR}/lang/Assume.cpp
|
||||||
@@ -55,8 +77,10 @@ list(APPEND SRC_FILES ${FOLLY_DIR}/Executor.cpp
|
|||||||
${FOLLY_DIR}/json_pointer.cpp
|
${FOLLY_DIR}/json_pointer.cpp
|
||||||
${FOLLY_DIR}/FormatArg.cpp
|
${FOLLY_DIR}/FormatArg.cpp
|
||||||
${FOLLY_DIR}/Format.cpp
|
${FOLLY_DIR}/Format.cpp
|
||||||
|
${FOLLY_DIR}/memory/detail/MallocImpl.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
message(STATUS "SRC FILES:- " ${SRC_FILES})
|
||||||
add_library(${PACKAGE_NAME} SHARED ${SRC_FILES})
|
add_library(${PACKAGE_NAME} SHARED ${SRC_FILES})
|
||||||
|
|
||||||
set(build_DIR ${CMAKE_SOURCE_DIR}/build)
|
set(build_DIR ${CMAKE_SOURCE_DIR}/build)
|
||||||
@@ -70,6 +94,8 @@ add_subdirectory(${GLOG_DIR} ${libglog_build_DIR})
|
|||||||
add_subdirectory(${DOUBLECONVERSION_DIR} ${doubleconversion_build_DIR})
|
add_subdirectory(${DOUBLECONVERSION_DIR} ${doubleconversion_build_DIR})
|
||||||
|
|
||||||
target_include_directories(${PACKAGE_NAME} PRIVATE
|
target_include_directories(${PACKAGE_NAME} PRIVATE
|
||||||
|
${LIBEVENT_DIR}
|
||||||
|
${LIBEVENT_DIR}/../
|
||||||
${BOOST_DIR}
|
${BOOST_DIR}
|
||||||
${BOOST_DIR}/../
|
${BOOST_DIR}/../
|
||||||
${GLOG_DIR}/../
|
${GLOG_DIR}/../
|
||||||
|
|||||||
4
android/third-party/LibEvent/ApplicationManifest.xml
vendored
Normal file
4
android/third-party/LibEvent/ApplicationManifest.xml
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
package="com.libevent">
|
||||||
|
</manifest>
|
||||||
13
android/third-party/LibEvent/CMakeLists.txt
vendored
Normal file
13
android/third-party/LibEvent/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
cmake_minimum_required (VERSION 3.6.0)
|
||||||
|
|
||||||
|
PROJECT(libevent C)
|
||||||
|
enable_language(C)
|
||||||
|
set(PACKAGE_NAME libevent)
|
||||||
|
set(LIBEVENT_DIR libevent-release-2.1.8-stable/)
|
||||||
|
list(APPEND DIR_LIST ${LIBEVENT_DIR} ${LIBEVENT_DIR}/include)
|
||||||
|
include_directories(${DIR_LIST})
|
||||||
|
file(GLOB SRCFILES ${LIBEVENT_DIR}/*.c)
|
||||||
|
message(STATUS "SRC FILES :- " ${SRCFILES})
|
||||||
|
add_library(${PACKAGE_NAME} SHARED ${SRCFILES})
|
||||||
|
install(TARGETS ${PACKAGE_NAME} DESTINATION ./build/)
|
||||||
|
target_link_libraries(${PACKAGE_NAME})
|
||||||
33
android/third-party/LibEvent/build.gradle
vendored
Normal file
33
android/third-party/LibEvent/build.gradle
vendored
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
|
android {
|
||||||
|
compileSdkVersion rootProject.compileSdkVersion
|
||||||
|
buildToolsVersion rootProject.buildToolsVersion
|
||||||
|
|
||||||
|
defaultConfig {
|
||||||
|
minSdkVersion rootProject.minSdkVersion
|
||||||
|
targetSdkVersion rootProject.targetSdkVersion
|
||||||
|
ndk {
|
||||||
|
abiFilters 'x86', 'x86_64', 'armeabi-v7a', 'arm64-v8a'
|
||||||
|
}
|
||||||
|
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
arguments '-DANDROID_TOOLCHAIN=clang'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
lintOptions {
|
||||||
|
abortOnError false
|
||||||
|
}
|
||||||
|
sourceSets {
|
||||||
|
main {
|
||||||
|
manifest.srcFile './ApplicationManifest.xml'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
externalNativeBuild {
|
||||||
|
cmake {
|
||||||
|
path './CMakeLists.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -17,6 +17,7 @@ include ':sonarcpp'
|
|||||||
include ':sample'
|
include ':sample'
|
||||||
include ':doubleconversion'
|
include ':doubleconversion'
|
||||||
include ':glog'
|
include ':glog'
|
||||||
|
include ':libevent'
|
||||||
|
|
||||||
|
|
||||||
project(':fbjni').projectDir = file('libs/fbjni')
|
project(':fbjni').projectDir = file('libs/fbjni')
|
||||||
@@ -27,3 +28,4 @@ project(':android').projectDir = file('android')
|
|||||||
project(':doubleconversion').projectDir = file('android/build/third-party-ndk/double-conversion/')
|
project(':doubleconversion').projectDir = file('android/build/third-party-ndk/double-conversion/')
|
||||||
project(':glog').projectDir = file('android/build/third-party-ndk/glog/')
|
project(':glog').projectDir = file('android/build/third-party-ndk/glog/')
|
||||||
project(':folly').projectDir = file('android/build/third-party-ndk/folly/')
|
project(':folly').projectDir = file('android/build/third-party-ndk/folly/')
|
||||||
|
project(':libevent').projectDir = file('android/build/third-party-ndk/LibEvent/')
|
||||||
|
|||||||
Reference in New Issue
Block a user