From 140c91e91188ee701d4a185d1ad771c23999f491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 1 Sep 2023 15:27:37 +0200 Subject: [PATCH] CI: switch to Meson build system --- .gitlab-ci.yml | 29 +++++++++---------- scripts/arm64-cross.ini | 11 +++++++ .../homebrew-native.ini | 0 .../windows-cross.ini | 7 +++++ 4 files changed, 31 insertions(+), 16 deletions(-) create mode 100644 scripts/arm64-cross.ini rename homebrew-native.ini => scripts/homebrew-native.ini (100%) rename windows-cross.ini => scripts/windows-cross.ini (64%) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5042e811..5c962938 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,22 +7,20 @@ variables: build_linux_x86_64: stage: build script: - - autoreconf -si - - ./configure --host=x86_64-linux-gnu - - make -j$(nproc) + - meson setup -D buildtype=release build + - meson compile -C build -v artifacts: paths: - - src/dynare-preprocessor + - build/src/dynare-preprocessor build_linux_arm64: stage: build script: - - autoreconf -si - - ./configure --host=aarch64-linux-gnu - - make -j$(nproc) + - meson setup -D buildtype=release --cross-file scripts/arm64-cross.ini build + - meson compile -C build -v artifacts: paths: - - src/dynare-preprocessor + - build/src/dynare-preprocessor build_windows_x86_64: stage: build @@ -31,9 +29,9 @@ build_windows_x86_64: - '[[ -f tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst ]] || wget $WGET_OPTIONS -P tarballs http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst' - mkdir -p deps - tar xf tarballs/mingw-w64-x86_64-boost-$MINGW64_BOOST_VERSION-any.pkg.tar.zst --directory deps - - autoreconf -si - - ./configure --host=x86_64-w64-mingw32 --with-boost=$(pwd)/deps/mingw64/include - - make -j$(nproc) + - echo -e "[properties]\nboost_root = '$(pwd)/deps/mingw64/'" > boost.ini + - meson setup -D buildtype=release --cross-file scripts/windows-cross.ini --cross-file boost.ini build + - meson compile -C build -v cache: # This cache is shared between all branches, to save space key: $CI_JOB_NAME @@ -41,16 +39,15 @@ build_windows_x86_64: - tarballs/ artifacts: paths: - - src/dynare-preprocessor.exe + - build/src/dynare-preprocessor.exe build_macos_x86_64: stage: build tags: - macOS script: - - autoreconf -si - - arch -x86_64 ./configure CC=gcc-13 CXX=g++-13 LEX=/usr/local/opt/flex/bin/flex YACC=/usr/local/opt/bison/bin/bison - - arch -x86_64 make -j$(sysctl -n hw.ncpu) + - arch -x86_64 meson setup -D buildtype=release --native-file scripts/homebrew-native.ini build + - arch -x86_64 meson compile -C build -v artifacts: paths: - - src/dynare-preprocessor + - build/src/dynare-preprocessor diff --git a/scripts/arm64-cross.ini b/scripts/arm64-cross.ini new file mode 100644 index 00000000..70c1703f --- /dev/null +++ b/scripts/arm64-cross.ini @@ -0,0 +1,11 @@ +# Meson cross file for targeting Linux arm64 + +[binaries] +cpp = 'aarch64-linux-gnu-g++' +strip = 'aarch64-linux-gnu-strip' + +[host_machine] +system = 'linux' +cpu_family = 'aarch64' +cpu = 'aarch64' +endian = 'little' diff --git a/homebrew-native.ini b/scripts/homebrew-native.ini similarity index 100% rename from homebrew-native.ini rename to scripts/homebrew-native.ini diff --git a/windows-cross.ini b/scripts/windows-cross.ini similarity index 64% rename from windows-cross.ini rename to scripts/windows-cross.ini index d0319221..18c2fa22 100644 --- a/windows-cross.ini +++ b/scripts/windows-cross.ini @@ -11,5 +11,12 @@ cpu_family = 'x86_64' cpu = 'x86_64' endian = 'little' +[built-in options] +prefer_static = true + +# See the comments in the main Dynare Meson cross-file +cpp_args = [ '-fstack-protector', '-march=nocona', '-msahf', '-mtune=generic' ] +cpp_link_args = [ '-fstack-protector' ] + #[properties] #boost_root = '/home/sebastien/dynare/unstable/preprocessor/deps/mingw64/'