From 30ba5bef5a65480eecf9d9a428ae363b57555499 Mon Sep 17 00:00:00 2001 From: Ivan Max Date: Mon, 4 Sep 2023 13:32:27 +0300 Subject: [PATCH] termux_step_configure_cmake.sh: setting `CMAKE_ADDITIONAL_ARGS` when compiling based on glibc --- .../configure/termux_step_configure_cmake.sh | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/scripts/build/configure/termux_step_configure_cmake.sh b/scripts/build/configure/termux_step_configure_cmake.sh index 074daa41c6..7d3b9886ed 100644 --- a/scripts/build/configure/termux_step_configure_cmake.sh +++ b/scripts/build/configure/termux_step_configure_cmake.sh @@ -25,11 +25,16 @@ termux_step_configure_cmake() { CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_CROSSCOMPILING=True") CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_LINKER=$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD $LDFLAGS") - CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_NAME=Android") - CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL") - CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC") - CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_TERMUX_TOOL_C_COMPILER=$CMAKE_TERMUX_TOOL_C_COMPILER") - CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN") + if [ "$TERMUX_PACKAGE_LIBRARY" = "bionic" ]; then + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_NAME=Android") + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_VERSION=$TERMUX_PKG_API_LEVEL") + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_TERMUX_TOOL_C_COMPILER=$CMAKE_TERMUX_TOOL_C_COMPILER") + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_ANDROID_STANDALONE_TOOLCHAIN=$TERMUX_STANDALONE_TOOLCHAIN") + elif [ "$TERMUX_PACKAGE_LIBRARY" = "glibc" ]; then + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_NAME=Linux") + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_TERMUX_TOOL_C_COMPILER=$CC") + fi + CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_PROCESSOR=$CMAKE_PROC") else CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_LINKER=$(command -v $LD) $LDFLAGS") fi