step_configure_cmake: mv cmake and ninja setup functions to step_configure

Only keep actual configure steps in termux_step_configure_cmake. This
way we can skip termux_step_configure_cmake on a continued build.
This commit is contained in:
Henrik Grimler 2021-08-22 12:48:47 +02:00
parent 3407018962
commit 12e395d3a9
3 changed files with 18 additions and 21 deletions

View File

@ -7,14 +7,19 @@ termux_step_configure() {
fi
termux_step_configure_autotools
elif [ "$TERMUX_PKG_FORCE_CMAKE" = "true" ] || [ -f "$TERMUX_PKG_SRCDIR/CMakeLists.txt" ]; then
if [ "$TERMUX_CONTINUE_BUILD" == "true" ]; then
termux_setup_cmake
if [ "$TERMUX_CMAKE_BUILD" = Ninja ]; then
termux_setup_ninja
fi
return;
termux_setup_cmake
if [ "$TERMUX_CMAKE_BUILD" = Ninja ]; then
termux_setup_ninja
fi
# Some packages, for example swift, uses cmake
# internally, but cannot be configured with our
# termux_step_configure_cmake function (CMakeLists.txt
# is not in src dir)
if [ -f "$TERMUX_PKG_SRCDIR/CMakeLists.txt" ] && \
[ "$TERMUX_CONTINUE_BUILD" == "false" ]; then
termux_step_configure_cmake
fi
termux_step_configure_cmake
elif [ -f "$TERMUX_PKG_SRCDIR/meson.build" ]; then
if [ "$TERMUX_CONTINUE_BUILD" == "true" ]; then
return;

View File

@ -1,22 +1,14 @@
termux_step_configure_cmake() {
termux_setup_cmake
local BUILD_TYPE=Release
[ "$TERMUX_DEBUG_BUILD" = "true" ] && 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=$(command -v ninja)
else
MAKE_PROGRAM_PATH=$(command -v make)
fi
BUILD_TYPE=Release
test "$TERMUX_DEBUG_BUILD" == "true" && BUILD_TYPE=Debug
CMAKE_PROC=$TERMUX_ARCH
test $CMAKE_PROC == "arm" && CMAKE_PROC='armv7-a'
if [ "$TERMUX_CONTINUE_BUILD" == "true" ]; then
return
fi
local CMAKE_ADDITIONAL_ARGS=()
if [ "$TERMUX_ON_DEVICE_BUILD" = "false" ]; then
CXXFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"

View File

@ -66,8 +66,8 @@ termux_step_start_build() {
termux_error_exit "Cannot continue this build, hostbuilt tools are missing"
fi
# Do not remove source dir on continued builds, the
# rest in this function can be skipped in this case
# The rest in this function can be skipped when doing
# a continued build
return
fi