Jenkins: Use CMake toolchain files on Windows as well

This commit is contained in:
RichardG867
2022-02-11 14:06:07 -03:00
parent c39a2a69dc
commit e45f5f67d2

View File

@@ -176,6 +176,15 @@ fi
echo [-] Building [$package_name] for [$arch] with flags [$cmake_flags] echo [-] Building [$package_name] for [$arch] with flags [$cmake_flags]
# Determine CMake toolchain file for this architecture.
case $arch in
32 | x86) toolchain="flags-gcc-i686";;
64 | x86_64) toolchain="flags-gcc-x86_64";;
ARM32 | arm32) toolchain="flags-gcc-armv7";;
ARM64 | arm64) toolchain="flags-gcc-aarch64";;
*) toolchain="flags-gcc-$arch";;
esac
# Perform platform-specific setup. # Perform platform-specific setup.
strip_binary=strip strip_binary=strip
if is_windows if is_windows
@@ -200,6 +209,9 @@ then
exit 2 exit 2
fi fi
echo [-] Using MSYSTEM [$MSYSTEM] echo [-] Using MSYSTEM [$MSYSTEM]
# Point CMake to the toolchain file.
cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=\"$cwd/cmake/$toolchain.cmake\""
elif is_mac elif is_mac
then then
# macOS lacks nproc, but sysctl can do the same job. # macOS lacks nproc, but sysctl can do the same job.
@@ -250,14 +262,6 @@ else
*) libdir="$arch_gnu";; *) libdir="$arch_gnu";;
esac esac
# Determine toolchain file for this architecture.
case $arch in
x86) toolchain="flags-gcc-i686";;
arm32) toolchain="flags-gcc-armv7";;
arm64) toolchain="flags-gcc-aarch64";;
*) toolchain="flags-gcc-$arch";;
esac
# Create CMake toolchain file. # Create CMake toolchain file.
cat << EOF > toolchain.cmake cat << EOF > toolchain.cmake
set(CMAKE_SYSTEM_NAME Linux) set(CMAKE_SYSTEM_NAME Linux)