test-gcc-disable-compiles:
  extends:
    - .gitlab-shared-gcc
  parallel:
    matrix:
      - DISABLE_FLAGS: [
          "keyring",
          "external-tokens ssh-token",
          "luks2-reencryption",
          "cryptsetup veritysetup integritysetup",
          "kernel_crypto",
          "udev",
          "internal-argon2",
          "blkid",
          "hw-opal"
      ]
  artifacts:
    name: "meson-build-logs-$CI_COMMIT_REF_NAME"
    paths:
      - meson_builddir/meson-logs
  script:
    - DEBIAN_FRONTEND=noninteractive apt-get -yq install meson ninja-build
    - export CFLAGS="-Wall -Werror"
    - ./autogen.sh
    - echo "Configuring with --disable-$DISABLE_FLAGS"
    - ./configure $(for i in $DISABLE_FLAGS; do echo "--disable-$i"; done)
    - make -j
    - make -j check-programs
    - git checkout -f && git clean -xdf
    - meson -v
    - echo "Configuring with -D$DISABLE_FLAGS=false"
    - meson setup meson_builddir $(for i in $DISABLE_FLAGS; do [ "$i" == "internal-argon2" ] && echo "-Dargon-implementation=internal" || echo "-D$i=false"; done)
    - ninja -C meson_builddir
