Add support for old parallel cmake arguments
This commit is contained in:
parent
95977a13e4
commit
5889613b4e
@ -11,7 +11,7 @@ env:
|
|||||||
- IMPLEMENTATION_NAME=tdlib
|
- IMPLEMENTATION_NAME=tdlib
|
||||||
- IMPLEMENTATION_NAME=tdlight
|
- IMPLEMENTATION_NAME=tdlight
|
||||||
osx_image: xcode11.3
|
osx_image: xcode11.3
|
||||||
dist: bionic
|
dist: xenial
|
||||||
before_install:
|
before_install:
|
||||||
- cp .travis.settings.xml $HOME/.m2/settings.xml
|
- cp .travis.settings.xml $HOME/.m2/settings.xml
|
||||||
- chmod +x travis/build.sh
|
- chmod +x travis/build.sh
|
||||||
|
@ -51,11 +51,12 @@ cd ./generated/td_build/
|
|||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=$(realpath ../td_bin/) \
|
-DCMAKE_INSTALL_PREFIX:PATH=$(realpath ../td_bin/) \
|
||||||
-DTD_ENABLE_JNI=ON \
|
-DTD_ENABLE_JNI=ON \
|
||||||
|
${CMAKE_EXTRA_ARGUMENTS} \
|
||||||
../implementation
|
../implementation
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
echo "Compiling ${IMPLEMENTATION_NAME} td..."
|
echo "Compiling ${IMPLEMENTATION_NAME} td..."
|
||||||
cmake --build . --target install --parallel ${CPU_CORES}
|
cmake --build . --target install ${CPU_CORES}
|
||||||
|
|
||||||
|
|
||||||
echo "Done."
|
echo "Done."
|
||||||
|
@ -69,11 +69,12 @@ cmake \
|
|||||||
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
|
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
|
||||||
-DTDNATIVES_CPP_SRC_DIR:PATH=$(realpath ../src/main/jni-cpp-src/) \
|
-DTDNATIVES_CPP_SRC_DIR:PATH=$(realpath ../src/main/jni-cpp-src/) \
|
||||||
-DOPENSSL_USE_STATIC_LIBS=True \
|
-DOPENSSL_USE_STATIC_LIBS=True \
|
||||||
|
${CMAKE_EXTRA_ARGUMENTS} \
|
||||||
$(realpath ../src/main/jni-cpp-src/)
|
$(realpath ../src/main/jni-cpp-src/)
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
echo "Compiling ${IMPLEMENTATION_NAME} jni..."
|
echo "Compiling ${IMPLEMENTATION_NAME} jni..."
|
||||||
cmake --build . --target install --parallel ${CPU_CORES}
|
cmake --build . --target install ${CPU_CORES}
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
# Copy to resources
|
# Copy to resources
|
||||||
|
@ -51,15 +51,16 @@ cd ./generated/td_tools/
|
|||||||
cmake \
|
cmake \
|
||||||
-DCMAKE_BUILD_TYPE=Release \
|
-DCMAKE_BUILD_TYPE=Release \
|
||||||
-DTD_ENABLE_JNI=ON \
|
-DTD_ENABLE_JNI=ON \
|
||||||
|
${CMAKE_EXTRA_ARGUMENTS} \
|
||||||
../implementation/
|
../implementation/
|
||||||
|
|
||||||
# Run cmake to generate common tools
|
# Run cmake to generate common tools
|
||||||
echo "Generating cross compilation tools..."
|
echo "Generating cross compilation tools..."
|
||||||
cmake --build . --target prepare_cross_compiling --parallel ${CPU_CORES}
|
cmake --build . --target prepare_cross_compiling ${CPU_CORES}
|
||||||
|
|
||||||
# Run cmake to generate java tools
|
# Run cmake to generate java tools
|
||||||
echo "Generating java tools..."
|
echo "Generating java tools..."
|
||||||
cmake --build . --target td_generate_java_api --parallel ${CPU_CORES}
|
cmake --build . --target td_generate_java_api ${CPU_CORES}
|
||||||
|
|
||||||
echo "Generated executable '$(realpath ./td/generate/generate_common)'"
|
echo "Generated executable '$(realpath ./td/generate/generate_common)'"
|
||||||
echo "Generated executable '$(realpath ./td/generate/td_generate_java_api)'"
|
echo "Generated executable '$(realpath ./td/generate/td_generate_java_api)'"
|
||||||
|
@ -69,11 +69,12 @@ cmake -DCMAKE_BUILD_TYPE=Release \
|
|||||||
-DTDNATIVES_BIN_DIR=$(realpath ../tdjni_bin/) \
|
-DTDNATIVES_BIN_DIR=$(realpath ../tdjni_bin/) \
|
||||||
-DTDNATIVES_DOCS_BIN_DIR=$(realpath ../tdjni_docs/) \
|
-DTDNATIVES_DOCS_BIN_DIR=$(realpath ../tdjni_docs/) \
|
||||||
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
|
-DJAVA_SRC_DIR=$(realpath ../src/main/jni-java-src/) \
|
||||||
|
${CMAKE_EXTRA_ARGUMENTS} \
|
||||||
$(realpath ../src/main/jni-cpp-src/)
|
$(realpath ../src/main/jni-cpp-src/)
|
||||||
|
|
||||||
# Run cmake to generate TdApi.java
|
# Run cmake to generate TdApi.java
|
||||||
echo "Generating TdApi.java..."
|
echo "Generating TdApi.java..."
|
||||||
cmake --build . --target td_generate_java_api --config Release --parallel ${CPU_CORES}
|
cmake --build . --target td_generate_java_api --config Release ${CPU_CORES}
|
||||||
cd ..
|
cd ..
|
||||||
|
|
||||||
echo "Patching TdApi.java..."
|
echo "Patching TdApi.java..."
|
||||||
|
@ -5,11 +5,11 @@ set -e
|
|||||||
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"
|
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"
|
||||||
if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then
|
if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then
|
||||||
export CPU_ARCHITECTURE_NAME="aarch64"
|
export CPU_ARCHITECTURE_NAME="aarch64"
|
||||||
export CPU_CORES="2"
|
export CPU_CORES_NUM="2"
|
||||||
else
|
else
|
||||||
CPU_ARCHITECTURE_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
|
CPU_ARCHITECTURE_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
|
||||||
export CPU_ARCHITECTURE_NAME;
|
export CPU_ARCHITECTURE_NAME;
|
||||||
export CPU_CORES="2"
|
export CPU_CORES_NUM="2"
|
||||||
fi
|
fi
|
||||||
OPERATING_SYSTEM_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_OS_NAME}")"
|
OPERATING_SYSTEM_NAME="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_OS_NAME}")"
|
||||||
export OPERATING_SYSTEM_NAME
|
export OPERATING_SYSTEM_NAME
|
||||||
@ -25,17 +25,20 @@ if [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
|||||||
export CMAKE_EXTRA_ARGUMENTS="-A x64 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
|
export CMAKE_EXTRA_ARGUMENTS="-A x64 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake"
|
||||||
export PATH="$PATH:/c/tools/php74:/c/PHP:/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64:/c/Program Files/OpenJDK/openjdk-11.0.8_10/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/bin:/c/Program Files/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/base64/tools:/c/Program Files/NASM"
|
export PATH="$PATH:/c/tools/php74:/c/PHP:/c/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64:/c/Program Files/OpenJDK/openjdk-11.0.8_10/bin:/c/Program Files/CMake/bin:/c/ProgramData/chocolatey/bin:/c/Program Files/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/maven/apache-maven-3.6.3/bin:/c/ProgramData/chocolatey/lib/base64/tools:/c/Program Files/NASM"
|
||||||
export JAVA_HOME="/c/Program Files/OpenJDK/openjdk-11.0.8_10"
|
export JAVA_HOME="/c/Program Files/OpenJDK/openjdk-11.0.8_10"
|
||||||
|
export CPU_CORES=" -- -m"
|
||||||
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
export CMAKE_EXTRA_ARGUMENTS=""
|
export CMAKE_EXTRA_ARGUMENTS=""
|
||||||
export PATH="$PATH:$(/usr/libexec/java_home -v 14)"
|
export PATH="$PATH:$(/usr/libexec/java_home -v 14)"
|
||||||
export JAVA_HOME="$(/usr/libexec/java_home -v 14)"
|
export JAVA_HOME="$(/usr/libexec/java_home -v 14)"
|
||||||
export JAVA_INCLUDE_PATH="$(/usr/libexec/java_home -v 14)/include"
|
export JAVA_INCLUDE_PATH="$(/usr/libexec/java_home -v 14)/include"
|
||||||
|
export CPU_CORES=" -- -j${CPU_CORES_NUM}"
|
||||||
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||||
export CMAKE_EXTRA_ARGUMENTS=""
|
export CMAKE_EXTRA_ARGUMENTS=""
|
||||||
export TRAVIS_CPU_ARCH_JAVA="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
|
export TRAVIS_CPU_ARCH_JAVA="$(tr '[:upper:]' '[:lower:]'<<<"${TRAVIS_CPU_ARCH}")"
|
||||||
export PATH="$PATH:/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/bin"
|
export PATH="$PATH:/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/bin"
|
||||||
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA"
|
export JAVA_HOME="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA"
|
||||||
export JAVA_INCLUDE_PATH="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/include"
|
export JAVA_INCLUDE_PATH="/usr/lib/jvm/java-11-openjdk-$TRAVIS_CPU_ARCH_JAVA/include"
|
||||||
|
export CPU_CORES=" -- -j${CPU_CORES_NUM}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# ====== Print variables
|
# ====== Print variables
|
||||||
@ -57,6 +60,7 @@ echo "MAVEN_OPTS=${MAVEN_OPTS}"
|
|||||||
echo "TRAVIS_CPU_ARCH=${TRAVIS_CPU_ARCH}"
|
echo "TRAVIS_CPU_ARCH=${TRAVIS_CPU_ARCH}"
|
||||||
echo "TRAVIS_CPU_ARCH_JAVA=${TRAVIS_CPU_ARCH_JAVA}"
|
echo "TRAVIS_CPU_ARCH_JAVA=${TRAVIS_CPU_ARCH_JAVA}"
|
||||||
echo "CPU_ARCHITECTURE_NAME=${CPU_ARCHITECTURE_NAME}"
|
echo "CPU_ARCHITECTURE_NAME=${CPU_ARCHITECTURE_NAME}"
|
||||||
|
echo "CPU_CORES_NUM=${CPU_CORES_NUM}"
|
||||||
echo "CPU_CORES=${CPU_CORES}"
|
echo "CPU_CORES=${CPU_CORES}"
|
||||||
echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
|
echo "TRAVIS_OS_NAME=${TRAVIS_OS_NAME}"
|
||||||
echo "OPERATING_SYSTEM_NAME=${OPERATING_SYSTEM_NAME}"
|
echo "OPERATING_SYSTEM_NAME=${OPERATING_SYSTEM_NAME}"
|
||||||
|
Loading…
Reference in New Issue
Block a user