From b50258245df7c2492e90050b4f79feec813c6870 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 7 Dec 2022 19:07:51 +1100 Subject: [PATCH] Tools: move to compiling 64-bit Windows executables Co-authored-by: davidbuzz@gmail.com Co-authored-by: robertlong13 cygwin has dropped 32-bit support --- Tools/scripts/cygwin_build.sh | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/Tools/scripts/cygwin_build.sh b/Tools/scripts/cygwin_build.sh index ea6830c0d7..7761bd5ae3 100755 --- a/Tools/scripts/cygwin_build.sh +++ b/Tools/scripts/cygwin_build.sh @@ -8,13 +8,22 @@ set -x +# TOOLCHAIN=i686-pc-cygwin +TOOLCHAIN=x86_64-pc-cygwin +GPP_COMPILER="${TOOLCHAIN}-g++" + +$GPP_COMPILER -print-sysroot + +SYS_ROOT=$($GPP_COMPILER -print-sysroot) +echo "SYS_ROOT=$SYS_ROOT" + git config --global --add safe.directory /cygdrive/d/a/ardupilot/ardupilot rm -rf artifacts mkdir artifacts ( - python ./waf --color yes --toolchain i686-pc-cygwin --board sitl configure 2>&1 + python ./waf --color yes --toolchain $TOOLCHAIN --board sitl configure 2>&1 python ./waf plane 2>&1 python ./waf copter 2>&1 python ./waf heli 2>&1 @@ -22,8 +31,6 @@ mkdir artifacts python ./waf sub 2>&1 ) | tee artifacts/build.txt -i686-pc-cygwin-g++ -print-sysroot - # copy both with exe and without to cope with differences # between windows versions in CI cp -v build/sitl/bin/arduplane artifacts/ArduPlane.elf.exe @@ -38,7 +45,14 @@ cp -v build/sitl/bin/arducopter-heli artifacts/ArduHeli.elf cp -v build/sitl/bin/ardurover artifacts/ArduRover.elf cp -v build/sitl/bin/ardusub artifacts/ArduSub.elf -cp -v /usr/i686-pc-cygwin/sys-root/usr/bin/*.dll artifacts/ +# Find all cyg*.dll files returned by cygcheck for each exe in artifacts +# and copy them over +for exe in artifacts/*.exe; do + echo $exe + cygcheck $exe | grep -oP 'cyg[^\s\\/]+\.dll' | while read -r line; do + cp -v /usr/bin/$line artifacts/ + done +done git log -1 > artifacts/git.txt ls -l artifacts/