Adding options to disable cross compilation in cmake (#19404)

This commit is contained in:
Ivan Max 2024-03-04 20:39:22 +00:00 committed by GitHub
parent a9bd131668
commit 96379a33db
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View File

@ -25,7 +25,7 @@ termux_step_configure_cmake() {
LDFLAGS+=" --target=$CCTERMUX_HOST_PLATFORM"
fi
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_CROSSCOMPILING=True")
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_CROSSCOMPILING=$(test \"${TERMUX_PKG_CMAKE_CROSSCOMPILING}\" = \"true\" && echo True || echo False)")
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_LINKER=$TERMUX_STANDALONE_TOOLCHAIN/bin/$LD $LDFLAGS")
if [ "$TERMUX_PACKAGE_LIBRARY" = "bionic" ]; then
CMAKE_ADDITIONAL_ARGS+=("-DCMAKE_SYSTEM_NAME=Android")

View File

@ -185,6 +185,7 @@ termux_step_setup_variables() {
TERMUX_PYTHON_CROSSENV_PREFIX="$TERMUX_TOPDIR/python-crossenv-prefix-$TERMUX_ARCH" # python modules dependency location (only used in non-devices)
TERMUX_PYTHON_HOME=$TERMUX_PREFIX/lib/python${TERMUX_PYTHON_VERSION} # location of python libraries
TERMUX_PKG_MESON_NATIVE=false
TERMUX_PKG_CMAKE_CROSSCOMPILING=true
unset CFLAGS CPPFLAGS LDFLAGS CXXFLAGS
unset TERMUX_MESON_ENABLE_SOVERSION # setenv to enable SOVERSION suffix for shared libs built with Meson