build-package: mv termux_step_configure_cmake to scripts/build/configure/
This commit is contained in:
parent
0bb1da3146
commit
74f09e886b
@ -78,51 +78,8 @@ termux_step_pre_configure() {
|
||||
# Setup configure args and run $TERMUX_PKG_SRCDIR/configure. This function is called from termux_step_configure
|
||||
source scripts/build/configure/termux_step_configure_autotools.sh
|
||||
|
||||
termux_step_configure_cmake() {
|
||||
termux_setup_cmake
|
||||
|
||||
local TOOLCHAIN_ARGS="-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN"
|
||||
local BUILD_TYPE=MinSizeRel
|
||||
test -n "$TERMUX_DEBUG" && BUILD_TYPE=Debug
|
||||
|
||||
local CMAKE_PROC=$TERMUX_ARCH
|
||||
test $CMAKE_PROC == "arm" && CMAKE_PROC='armv7-a'
|
||||
local MAKE_PROGRAM_PATH
|
||||
if [ $TERMUX_CMAKE_BUILD = Ninja ]; then
|
||||
termux_setup_ninja
|
||||
MAKE_PROGRAM_PATH=$(which ninja)
|
||||
else
|
||||
MAKE_PROGRAM_PATH=$(which make)
|
||||
fi
|
||||
CFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM -fno-addrsig"
|
||||
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM -fno-addrsig"
|
||||
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
|
||||
|
||||
# XXX: CMAKE_{AR,RANLIB} needed for at least jsoncpp build to not
|
||||
# pick up cross compiled binutils tool in $PREFIX/bin:
|
||||
cmake -G "$TERMUX_CMAKE_BUILD" "$TERMUX_PKG_SRCDIR" \
|
||||
-DCMAKE_AR="$(which $AR)" \
|
||||
-DCMAKE_UNAME="$(which uname)" \
|
||||
-DCMAKE_RANLIB="$(which $RANLIB)" \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_CROSSCOMPILING=True \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS $CPPFLAGS" \
|
||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS $CPPFLAGS" \
|
||||
-DCMAKE_LINKER="$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD $LDFLAGS" \
|
||||
-DCMAKE_FIND_ROOT_PATH=$TERMUX_PREFIX \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \
|
||||
-DCMAKE_MAKE_PROGRAM=$MAKE_PROGRAM_PATH \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC \
|
||||
-DCMAKE_SYSTEM_NAME=Android \
|
||||
-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON \
|
||||
-DCMAKE_USE_SYSTEM_LIBRARIES=True \
|
||||
-DDOXYGEN_EXECUTABLE= \
|
||||
-DBUILD_TESTING=OFF \
|
||||
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS $TOOLCHAIN_ARGS
|
||||
}
|
||||
# Setup configure args and run cmake. This function is called from termux_step_configure
|
||||
source scripts/build/configure/termux_step_configure_cmake.sh
|
||||
|
||||
termux_step_configure_meson() {
|
||||
termux_setup_meson
|
||||
|
45
scripts/build/configure/termux_step_configure_cmake.sh
Normal file
45
scripts/build/configure/termux_step_configure_cmake.sh
Normal file
@ -0,0 +1,45 @@
|
||||
termux_step_configure_cmake() {
|
||||
termux_setup_cmake
|
||||
|
||||
local TOOLCHAIN_ARGS="-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN"
|
||||
local BUILD_TYPE=MinSizeRel
|
||||
test -n "$TERMUX_DEBUG" && BUILD_TYPE=Debug
|
||||
|
||||
local CMAKE_PROC=$TERMUX_ARCH
|
||||
test $CMAKE_PROC == "arm" && CMAKE_PROC='armv7-a'
|
||||
local MAKE_PROGRAM_PATH
|
||||
if [ $TERMUX_CMAKE_BUILD = Ninja ]; then
|
||||
termux_setup_ninja
|
||||
MAKE_PROGRAM_PATH=$(which ninja)
|
||||
else
|
||||
MAKE_PROGRAM_PATH=$(which make)
|
||||
fi
|
||||
CFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM -fno-addrsig"
|
||||
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM -fno-addrsig"
|
||||
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
|
||||
|
||||
# XXX: CMAKE_{AR,RANLIB} needed for at least jsoncpp build to not
|
||||
# pick up cross compiled binutils tool in $PREFIX/bin:
|
||||
cmake -G "$TERMUX_CMAKE_BUILD" "$TERMUX_PKG_SRCDIR" \
|
||||
-DCMAKE_AR="$(which $AR)" \
|
||||
-DCMAKE_UNAME="$(which uname)" \
|
||||
-DCMAKE_RANLIB="$(which $RANLIB)" \
|
||||
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
|
||||
-DCMAKE_CROSSCOMPILING=True \
|
||||
-DCMAKE_C_FLAGS="$CFLAGS $CPPFLAGS" \
|
||||
-DCMAKE_CXX_FLAGS="$CXXFLAGS $CPPFLAGS" \
|
||||
-DCMAKE_LINKER="$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD $LDFLAGS" \
|
||||
-DCMAKE_FIND_ROOT_PATH=$TERMUX_PREFIX \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE=ONLY \
|
||||
-DCMAKE_FIND_ROOT_PATH_MODE_LIBRARY=ONLY \
|
||||
-DCMAKE_INSTALL_PREFIX=$TERMUX_PREFIX \
|
||||
-DCMAKE_MAKE_PROGRAM=$MAKE_PROGRAM_PATH \
|
||||
-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC \
|
||||
-DCMAKE_SYSTEM_NAME=Android \
|
||||
-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL \
|
||||
-DCMAKE_SKIP_INSTALL_RPATH=ON \
|
||||
-DCMAKE_USE_SYSTEM_LIBRARIES=True \
|
||||
-DDOXYGEN_EXECUTABLE= \
|
||||
-DBUILD_TESTING=OFF \
|
||||
$TERMUX_PKG_EXTRA_CONFIGURE_ARGS $TOOLCHAIN_ARGS
|
||||
}
|
Loading…
Reference in New Issue
Block a user