Add build type option
This commit is contained in:
parent
ad15d80813
commit
975937fb81
@ -1 +1 @@
|
||||
Subproject commit 5fddef3857e4d620f4c50c86cf93ac6cd9635bfd
|
||||
Subproject commit af4693eac7318ac485334ab84ddc44f05d2fd952
|
@ -1,5 +1,6 @@
|
||||
#!/bin/bash -e
|
||||
set -e
|
||||
export BUILD_TYPE=Release
|
||||
export MAVEN_OPTS="--add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/javax.crypto=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED"
|
||||
|
||||
echo "MATRIX_OS: $GH_MATRIX_OS"
|
||||
@ -91,6 +92,7 @@ fi
|
||||
|
||||
# ====== Print variables
|
||||
echo "REVISION=${REVISION}"
|
||||
echo "BUILD_TYPE=${BUILD_TYPE}"
|
||||
echo "TD_SRC_DIR=${TD_SRC_DIR}"
|
||||
echo "TD_BIN_DIR=${TD_BIN_DIR}"
|
||||
echo "TDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR}"
|
||||
|
@ -3,6 +3,7 @@
|
||||
# OPERATING_SYSTEM_NAME = <windows | linux | osx>
|
||||
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64 | 386 | armv6 | armv7 | ppc64le>
|
||||
# IMPLEMENTATION_NAME = <tdlib | tdlight>
|
||||
# BUILD_TYPE = <Debug | Release | RelWithDebInfo | MinSizeRel>
|
||||
# CPU_CORES = "-- -j<cores>" or "-m" on Windows
|
||||
# OTHER REQUIRED ENVIRONMENT VARIABLES:
|
||||
# CMAKE_EXTRA_ARGUMENTS = <args>
|
||||
@ -20,6 +21,10 @@ if [ -z "${IMPLEMENTATION_NAME}" ]; then
|
||||
echo "Missing parameter: IMPLEMENTATION_NAME"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${BUILD_TYPE}" ]; then
|
||||
echo "Missing parameter: BUILD_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${CPU_CORES}" ]; then
|
||||
echo "Missing parameter: CPU_CORES"
|
||||
exit 1
|
||||
@ -33,6 +38,7 @@ echo "Current directory: $(pwd)"
|
||||
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
|
||||
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
|
||||
echo "Td implementation: ${IMPLEMENTATION_NAME}"
|
||||
echo "Build type: ${BUILD_TYPE}"
|
||||
echo "CPU cores count: ${CPU_CORES}"
|
||||
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
|
||||
|
||||
@ -48,7 +54,7 @@ echo "Creating missing folders..."
|
||||
# Build
|
||||
echo "Compiling ${IMPLEMENTATION_NAME} td..."
|
||||
cd ./generated/td_build/
|
||||
cmake --build . --target install --config Release ${CPU_CORES}
|
||||
cmake --build . --target install --config "${BUILD_TYPE}" ${CPU_CORES}
|
||||
|
||||
|
||||
echo "Done."
|
||||
|
@ -4,6 +4,7 @@
|
||||
# OPERATING_SYSTEM_NAME_SHORT = <win | linux | osx>
|
||||
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64 | 386 | armv6 | armv7 | ppc64le>
|
||||
# IMPLEMENTATION_NAME = <tdlib | tdlight>
|
||||
# BUILD_TYPE = <Debug | Release | RelWithDebInfo | MinSizeRel>
|
||||
# CPU_CORES = "-- -j<cores>" or "-m" on Windows
|
||||
# OTHER REQUIRED ENVIRONMENT VARIABLES:
|
||||
# CMAKE_EXTRA_ARGUMENTS = <args>
|
||||
@ -25,6 +26,10 @@ if [ -z "${IMPLEMENTATION_NAME}" ]; then
|
||||
echo "Missing parameter: IMPLEMENTATION_NAME"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${BUILD_TYPE}" ]; then
|
||||
echo "Missing parameter: BUILD_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${CPU_CORES}" ]; then
|
||||
echo "Missing parameter: CPU_CORES"
|
||||
exit 1
|
||||
@ -38,6 +43,7 @@ echo "Current directory: $(pwd)"
|
||||
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
|
||||
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
|
||||
echo "Td implementation: ${IMPLEMENTATION_NAME}"
|
||||
echo "Build type: ${BUILD_TYPE}"
|
||||
echo "CPU cores count: ${CPU_CORES}"
|
||||
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
|
||||
|
||||
@ -73,7 +79,7 @@ fi
|
||||
echo "Configuring CMake..."
|
||||
cd ./generated/tdjni_build/
|
||||
cmake \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
"-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
|
||||
-DTD_GENERATED_BINARIES_DIR=${TD_GENERATED_BINARIES_DIR} \
|
||||
-DTD_SRC_DIR=$(realpath -m ../implementation/) \
|
||||
-DTDNATIVES_BIN_DIR=$(realpath -m ../tdjni_bin/) \
|
||||
@ -87,7 +93,7 @@ cmake \
|
||||
|
||||
# Build
|
||||
echo "Compiling ${IMPLEMENTATION_NAME} jni..."
|
||||
cmake --build . --target install --config Release ${CPU_CORES}
|
||||
cmake --build . --target install --config "${BUILD_TYPE}" ${CPU_CORES}
|
||||
cd ..
|
||||
|
||||
# Copy to resources
|
||||
|
@ -3,6 +3,7 @@
|
||||
# OPERATING_SYSTEM_NAME = <windows | linux | osx>
|
||||
# CPU_ARCHITECTURE_NAME = <amd64 | aarch64 | 386 | armv6 | armv7 | ppc64le>
|
||||
# IMPLEMENTATION_NAME = <tdlib | tdlight>
|
||||
# BUILD_TYPE = <Debug | Release | RelWithDebInfo | MinSizeRel>
|
||||
# CPU_CORES = "-- -j<cores>" or "-m" on Windows
|
||||
# OTHER REQUIRED ENVIRONMENT VARIABLES:
|
||||
# CMAKE_EXTRA_ARGUMENTS = <args>
|
||||
@ -20,6 +21,10 @@ if [ -z "${IMPLEMENTATION_NAME}" ]; then
|
||||
echo "Missing parameter: IMPLEMENTATION_NAME"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${BUILD_TYPE}" ]; then
|
||||
echo "Missing parameter: BUILD_TYPE"
|
||||
exit 1
|
||||
fi
|
||||
if [ -z "${CPU_CORES}" ]; then
|
||||
echo "Missing parameter: CPU_CORES"
|
||||
exit 1
|
||||
@ -33,6 +38,7 @@ echo "Current directory: $(pwd)"
|
||||
echo "Operating system: ${OPERATING_SYSTEM_NAME}"
|
||||
echo "Architecture: ${CPU_ARCHITECTURE_NAME}"
|
||||
echo "Td implementation: ${IMPLEMENTATION_NAME}"
|
||||
echo "Build type: ${BUILD_TYPE}"
|
||||
echo "CPU cores count: ${CPU_CORES}"
|
||||
echo "CMake extra arguments: '${CMAKE_EXTRA_ARGUMENTS}'"
|
||||
|
||||
@ -57,7 +63,7 @@ INSTALL_PREFIX="$(realpath -m ../td_bin/)"
|
||||
INSTALL_BINDIR="$(realpath -m ../td_bin/bin)"
|
||||
echo "Install prefix: $INSTALL_PREFIX"
|
||||
echo "Install bindir: $INSTALL_BINDIR"
|
||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||
cmake "-DCMAKE_BUILD_TYPE=${BUILD_TYPE}" \
|
||||
-DCMAKE_INSTALL_PREFIX:PATH="$INSTALL_PREFIX" \
|
||||
-DCMAKE_INSTALL_BINDIR:PATH="$INSTALL_BINDIR" \
|
||||
-DTD_ENABLE_JNI=ON \
|
||||
|
Loading…
x
Reference in New Issue
Block a user