osxcross/tools/osxcross-cmake
Nikos Chantziaras 23f82c2057
Fix cmake wrapper breaking cmake build options
Since cmake 3.20, "-D" prevents any build options (--build, --target, -j,
etc) from working. It will abort with an "unrecognized argument" error.

Fix the issue by passing the toolchain file as an env variable to cmake,
not with -D.
2021-11-23 17:14:40 +02:00

18 lines
340 B
Bash
Executable File

#!/usr/bin/env bash
set -e
dir=`dirname "$0"`
progname=`basename "$0"`
host=${progname%-cmake}
if test "$host" = "osxcross" ; then
echo "Do not invoke this script directly."
exit 1
fi
eval "`$dir/$host-osxcross-conf`"
export OSXCROSS_HOST="$host"
export CMAKE_TOOLCHAIN_FILE="$OSXCROSS_TARGET_DIR"/toolchain.cmake
exec cmake "$@"