Fix vendor libs build
This commit is contained in:
parent
412df2e7be
commit
6cd6d9ef5d
@ -7,19 +7,19 @@ cmake_policy(SET CMP0065 OLD)
|
||||
# - try if setting CRYPTOPP_NATIVE_ARCH=ON and adding -march=native to the compile commands for cryfs source files makes a difference
|
||||
# -> if yes, offer a cmake option to enable both of these
|
||||
|
||||
set(ANDROID_ABI arm64-v8a)
|
||||
set(ANDROID_NDK /ndk/23.1.7779620/)
|
||||
set(ANDROID_PLATFORM android-21)
|
||||
set(ANDROID_TOOLCHAIN clang)
|
||||
|
||||
set(CMAKE_SYSTEM_NAME Android)
|
||||
set(CMAKE_SYSTEM_VERSION 21)
|
||||
set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
|
||||
set(CMAKE_ANDROID_NDK ${ANDROID_NDK})
|
||||
set(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
|
||||
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)
|
||||
set(ANDROID TRUE) # Current toolchain file doesn't set this variable which is needed by spdlog
|
||||
#set(ANDROID_ABI arm64-v8a)
|
||||
#set(ANDROID_NDK /ndk/23.1.7779620/)
|
||||
#set(ANDROID_PLATFORM android-21)
|
||||
#set(ANDROID_TOOLCHAIN clang)
|
||||
#
|
||||
#set(CMAKE_SYSTEM_NAME Android)
|
||||
#set(CMAKE_SYSTEM_VERSION 21)
|
||||
#set(CMAKE_ANDROID_ARCH_ABI arm64-v8a)
|
||||
#set(CMAKE_ANDROID_NDK ${ANDROID_NDK})
|
||||
#set(CMAKE_ANDROID_STL_TYPE c++_static)
|
||||
#
|
||||
#set(CMAKE_TOOLCHAIN_FILE ${CMAKE_ANDROID_NDK}/build/cmake/android.toolchain.cmake)
|
||||
#set(ANDROID TRUE) # Current toolchain file doesn't set this variable which is needed by spdlog
|
||||
|
||||
project(cryfs)
|
||||
|
||||
|
1
vendor/boost/.gitignore
vendored
Normal file
1
vendor/boost/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/build
|
30
vendor/boost/CMakeLists.txt
vendored
30
vendor/boost/CMakeLists.txt
vendored
@ -1,12 +1,36 @@
|
||||
project(libboost)
|
||||
|
||||
add_library(boost INTERFACE)
|
||||
set(BOOST_OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/build/${CMAKE_ANDROID_ARCH_ABI}")
|
||||
set(BOOST_STATIC_LIBS
|
||||
${BOOST_OUTPUT}/lib/libboost_atomic-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_chrono-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_container-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_date_time-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_exception-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_filesystem-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_serialization-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_system-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_thread-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_wserialization-clang-mt-a64-1_76.a
|
||||
)
|
||||
add_custom_target(
|
||||
vendor_boost
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/android-build.sh ${CMAKE_ANDROID_NDK} ${CMAKE_ANDROID_ARCH_ABI}
|
||||
BYPRODUCTS ${BOOST_STATIC_LIBS}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
set(BOOST_OUTPUT "Boost-for-Android/build/out/${CMAKE_ANDROID_ARCH_ABI}")
|
||||
file(GLOB BOOST_STATIC_LIBS ${BOOST_OUTPUT}/lib/libboost_*.a)
|
||||
add_dependencies(boost vendor_boost)
|
||||
target_include_directories(boost SYSTEM INTERFACE ${BOOST_OUTPUT}/include/boost-1_76)
|
||||
target_link_libraries(boost INTERFACE vendor_boost ${BOOST_STATIC_LIBS})
|
||||
target_link_libraries(boost INTERFACE
|
||||
${BOOST_OUTPUT}/lib/libboost_atomic-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_chrono-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_container-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_date_time-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_exception-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_filesystem-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_serialization-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_system-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_thread-clang-mt-a64-1_76.a
|
||||
${BOOST_OUTPUT}/lib/libboost_wserialization-clang-mt-a64-1_76.a
|
||||
)
|
||||
|
10
vendor/boost/android-build.sh
vendored
10
vendor/boost/android-build.sh
vendored
@ -1,14 +1,13 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ -d Boost-for-Android/build/out/$2 ]; then
|
||||
if ls build/$2/lib/libboost_*.a 1>&2 2>/dev/null; then
|
||||
echo "boost already built for $2";
|
||||
exit 0
|
||||
fi
|
||||
|
||||
mkdir -p build && rm -rf build/$2 && cd Boost-for-Android || exit 1
|
||||
|
||||
BOOST_TAR=boost_1_76_0.tar.bz2
|
||||
|
||||
cd Boost-for-Android || exit 1
|
||||
|
||||
if [ ! -f $BOOST_TAR ]; then
|
||||
wget -O $BOOST_TAR https://boostorg.jfrog.io/artifactory/main/release/1.76.0/source/boost_1_76_0.tar.bz2 || exit 1
|
||||
fi
|
||||
@ -16,4 +15,5 @@ fi
|
||||
sha256sum -c ../checksum.txt && \
|
||||
./build-android.sh --boost=1.76.0 --arch=$2 --target-version=21 \
|
||||
--with-libraries=atomic,chrono,container,date_time,exception,filesystem,serialization,system,thread \
|
||||
$1
|
||||
$1 && \
|
||||
mv build/out/$2 ../build
|
||||
|
8
vendor/cryptopp/CMakeLists.txt
vendored
8
vendor/cryptopp/CMakeLists.txt
vendored
@ -19,5 +19,11 @@ set(USE_INTERMEDIATE_OBJECTS_TARGET OFF CACHE BOOL "")
|
||||
set(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING OFF CACHE BOOL "")
|
||||
|
||||
set(LIBCRYPTOPP_A "${CMAKE_CURRENT_SOURCE_DIR}/vendor_cryptopp/build/${CMAKE_ANDROID_ARCH_ABI}/libcryptopp.a")
|
||||
add_custom_command(OUTPUT ${LIBCRYPTOPP_A} COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/android-build.sh ${CMAKE_ANDROID_ARCH_ABI})
|
||||
add_custom_target(
|
||||
vendor_cryptopp
|
||||
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/android-build.sh ${CMAKE_ANDROID_NDK} ${CMAKE_ANDROID_ARCH_ABI}
|
||||
BYPRODUCTS ${LIBCRYPTOPP_A}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
#add_dependencies(cryptopp vendor_cryptopp)
|
||||
target_link_libraries(cryptopp INTERFACE ${LIBCRYPTOPP_A})
|
||||
|
11
vendor/cryptopp/android-build.sh
vendored
11
vendor/cryptopp/android-build.sh
vendored
@ -1,7 +1,8 @@
|
||||
#!/bin/sh
|
||||
#!/usr/bin/env bash
|
||||
|
||||
export ANDROID_NDK_ROOT=$1 && \
|
||||
cd vendor_cryptopp && \
|
||||
mkdir -p build/$1 && \
|
||||
TestScripts/setenv-android.sh 21 $1 && \
|
||||
make -f GNUmakefile-cross static && \
|
||||
mv libcryptopp.a build/$1
|
||||
mkdir -p build/$2 && \
|
||||
source TestScripts/setenv-android.sh 21 $2 && \
|
||||
make -f GNUmakefile-cross static && \
|
||||
mv libcryptopp.a build/$2
|
||||
|
@ -192,7 +192,6 @@ case "$ANDROID_CPU" in
|
||||
armv7*|armeabi*)
|
||||
CC="armv7a-linux-androideabi${ANDROID_API}-clang"
|
||||
CXX="armv7a-linux-androideabi${ANDROID_API}-clang++"
|
||||
AR="arm-linux-androideabi-ar"
|
||||
STRIP="arm-linux-androideabi-strip"
|
||||
OBJDUMP="arm-linux-androideabi-objdump"
|
||||
|
||||
@ -215,7 +214,6 @@ case "$ANDROID_CPU" in
|
||||
armv8*|aarch64|arm64*)
|
||||
CC="aarch64-linux-android${ANDROID_API}-clang"
|
||||
CXX="aarch64-linux-android${ANDROID_API}-clang++"
|
||||
AR="aarch64-linux-android-ar"
|
||||
STRIP="aarch64-linux-android-strip"
|
||||
OBJDUMP="aarch64-linux-android-objdump"
|
||||
|
||||
@ -235,7 +233,6 @@ case "$ANDROID_CPU" in
|
||||
i686|x86)
|
||||
CC="i686-linux-android${ANDROID_API}-clang"
|
||||
CXX="i686-linux-android${ANDROID_API}-clang++"
|
||||
AR="i686-linux-android-ar"
|
||||
STRIP="i686-linux-android-strip"
|
||||
OBJDUMP="i686-linux-android-objdump"
|
||||
|
||||
@ -257,7 +254,6 @@ case "$ANDROID_CPU" in
|
||||
x86_64|x64)
|
||||
CC="x86_64-linux-android${ANDROID_API}-clang"
|
||||
CXX="x86_64-linux-android${ANDROID_API}-clang++"
|
||||
AR="x86_64-linux-android-ar"
|
||||
STRIP="x86_64-linux-android-strip"
|
||||
OBJDUMP="x86_64-linux-android-objdump"
|
||||
|
||||
@ -283,6 +279,7 @@ esac
|
||||
|
||||
LD=$CC
|
||||
AS="llvm-as"
|
||||
AR="llvm-ar"
|
||||
RANLIB="llvm-ranlib"
|
||||
|
||||
echo "Configuring for Android API ${ANDROID_API} ($ANDROID_CPU)"
|
||||
|
Loading…
x
Reference in New Issue
Block a user