From e14bbb6f1bb3849d2d2c8b56924558122f2a5237 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 11 Feb 2022 13:55:12 -0300 Subject: [PATCH] Jenkins: Use CMake toolchain files for compiler flags --- .ci/build.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.ci/build.sh b/.ci/build.sh index 2f6902e6b..dddd32d9d 100644 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -250,6 +250,14 @@ else *) libdir="$arch_gnu";; 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. cat << EOF > toolchain.cmake set(CMAKE_SYSTEM_NAME Linux) @@ -271,6 +279,8 @@ set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) set(ENV{PKG_CONFIG_PATH} "") set(ENV{PKG_CONFIG_LIBDIR} "/usr/lib/$libdir/pkgconfig:/usr/share/$libdir/pkgconfig") + +include("$cwd/cmake/$toolchain.cmake") EOF cmake_flags_extra="$cmake_flags_extra -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake" strip_binary="$arch_gnu-strip"