././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.7455904 meson-1.9.1/0000755000175000017500000000000015064306101013505 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.editorconfig0000644000175000017500000000047215064306076016200 0ustar00eschwartzeschwartzroot = true [*] charset = utf-8 end_of_line = lf indent_style = space trim_trailing_whitespace = true insert_final_newline = true [*.[ch]] indent_size = 4 [*.cpp] indent_size = 4 [*.py] indent_size = 4 [*.vala] indent_size = 4 [*.xml] indent_size = 2 [meson.build] indent_size = 2 [*.json] indent_size = 2 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.flake80000644000175000017500000000166015064306076014676 0ustar00eschwartzeschwartz[flake8] extend-ignore = # E241: multiple spaces after ':' E241, # E251: unexpected spaces around keyword / parameter equals E251, # E261: at least two spaces before inline comment E261, # E265: block comment should start with '# ' E265, # E501: line too long E501, # E302: expected 2 blank lines, found 1 E302, # E305: expected 2 blank lines after class or function definition, found 1 E305, # E401: multiple imports on one line E401, # E266: too many leading '#' for block comment E266, # E402: module level import not at top of file E402, # E731: do not assign a lambda expression, use a def (too many false positives) E731, # E741: ambiguous variable name 'l' E741, # W504: line break after binary operator W504, # A003: builtin class attribute A003 per-file-ignores = mesonbuild/mesonlib.py:F401,F403 max-line-length = 120 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3154316 meson-1.9.1/.github/0000755000175000017500000000000015064306100015044 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/FUNDING.yml0000644000175000017500000000011015064306076016665 0ustar00eschwartzeschwartzgithub: [eli-schwartz] custom: ['https://mesonbuild.com/Donating.html'] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3155105 meson-1.9.1/.github/ISSUE_TEMPLATE/0000755000175000017500000000000015064306100017227 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/ISSUE_TEMPLATE/bug_report.md0000644000175000017500000000145115064306076021736 0ustar00eschwartzeschwartz--- name: Bug report about: Meson bug report title: '' labels: '' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Please include your `meson.build` files, preferably as a minimal toy example showing the issue. You may need to create simple source code files (don't include private/proprietary code). **Expected behavior** A clear and concise description of what you expected to happen. **system parameters** * Is this a [cross build](https://mesonbuild.com/Cross-compilation.html) or just a plain native build (for the same computer)? * what operating system (e.g. MacOS Catalina, Windows 10, CentOS 8.0, Ubuntu 18.04, etc.) * what Python version are you using e.g. 3.8.0 * what `meson --version` * what `ninja --version` if it's a Ninja build ././@PaxHeader0000000000000000000000000000003200000000000010210 xustar0026 mtime=1758563392.31643 meson-1.9.1/.github/workflows/0000755000175000017500000000000015064306100017101 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/cygwin.yml0000644000175000017500000000614415064306076021145 0ustar00eschwartzeschwartzname: cygwin concurrency: group: cygwin-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: - master # Stable branches such as 0.56 or 1.0 - '[0-9]+.[0-9]+' paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/cygwin.yml" - "run*tests.py" pull_request: paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/cygwin.yml" - "run*tests.py" permissions: contents: read jobs: test: runs-on: windows-latest name: ${{ matrix.NAME }} strategy: fail-fast: false matrix: include: - NAME: gccx64ninja ARCH: x86_64 env: MESON_CI_JOBNAME: cygwin-${{ matrix.NAME }} steps: # remove inheritable permissions since they break assumptions testsuite # makes about file modes - run: icacls . /inheritance:r /T /C - uses: actions/cache/restore@v4 id: restore-cache with: # should use 'pip3 cache dir' to discover this path path: C:\cygwin\home\runneradmin\.cache\pip key: cygwin-pip-${{ github.run_number }} restore-keys: cygwin-pip- - run: git config --global core.autocrlf input - uses: actions/checkout@v4 - uses: cygwin/cygwin-install-action@v5 with: platform: ${{ matrix.ARCH }} packages: | cmake gcc-fortran gcc-objc++ gcc-objc git gobject-introspection gtk-doc libboost-devel libglib2.0-devel libgtk3-devel libxml2-devel libxslt-devel make ninja python2-devel python3-devel python3-libxml2 python3-libxslt python39-pip python39-wheel vala zlib-devel - name: Run pip run: | export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32 python3 -m pip --disable-pip-version-check install gcovr fastjsonschema pefile pytest pytest-subtests pytest-xdist shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}' - uses: actions/cache/save@v4 with: # should use 'pip3 cache dir' to discover this path path: C:\cygwin\home\runneradmin\.cache\pip key: cygwin-pip-${{ github.run_number }} - name: Run tests run: | export PATH=/usr/bin:/usr/local/bin:$(cygpath ${SYSTEMROOT})/system32 python3 ./run_tests.py --backend=ninja env: # Cygwin's static boost installation is broken (some static library # variants such as boost_thread are not present) SKIP_STATIC_BOOST: 1 shell: C:\cygwin\bin\bash.exe --noprofile --norc -o igncr -eo pipefail '{0}' - uses: actions/upload-artifact@v4 with: name: ${{ matrix.NAME }} path: meson-test-run.* # test log should be saved on failure if: ${{ !cancelled() }} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/file_format.yml0000644000175000017500000000065015064306076022130 0ustar00eschwartzeschwartzname: File format check on: [push, pull_request] concurrency: group: file_fmt-${{ github.head_ref || github.ref }} cancel-in-progress: true permissions: contents: read jobs: format: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - run: python3 ./run_format_tests.py - run: python3 ./run_shell_checks.py ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/images.yml0000644000175000017500000000435715064306076021116 0ustar00eschwartzeschwartzname: CI image builder concurrency: group: img_builder-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: paths: - 'ci/ciimage/**' - '.github/workflows/images.yml' pull_request: branches: - master paths: - 'ci/ciimage/**' - '.github/workflows/images.yml' # Rebuild the images every week (Sunday) schedule: - cron: '0 0 * * 0' permissions: contents: read jobs: build: # do not run the weekly scheduled job in a fork if: github.event_name != 'schedule' || github.repository == 'mesonbuild/meson' env: HAS_DOCKER_CREDENTIALS: ${{ secrets.DOCKER_PASSWORD != '' }} name: ${{ matrix.cfg.name }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: cfg: - { name: Arch Linux, id: arch } - { name: CUDA (on Arch), id: cuda } - { name: CUDA Cross (on Ubuntu Jammy), id: cuda-cross } - { name: Fedora, id: fedora } - { name: Gentoo, id: gentoo } - { name: OpenSUSE, id: opensuse } - { name: Ubuntu Bionic, id: bionic } - { name: Ubuntu Rolling, id: ubuntu-rolling } steps: # Need v3 because of bionic - uses: actions/checkout@v3 # Login to dockerhub - name: Docker login if: (github.event_name == 'push' || github.event_name == 'schedule') && env.HAS_DOCKER_CREDENTIALS == 'true' uses: azure/docker-login@v1 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} # Build and test - name: Building the ${{ matrix.cfg.id }} image run: ./ci/ciimage/build.py -t build ${{ matrix.cfg.id }} - name: Testing the ${{ matrix.cfg.id }} image run: ./ci/ciimage/build.py -t test ${{ matrix.cfg.id }} # Publish - name: Push the ${{ matrix.cfg.id }} image run: docker push mesonbuild/${{ matrix.cfg.id }} if: (github.event_name == 'push' || github.event_name == 'schedule') && env.HAS_DOCKER_CREDENTIALS == 'true' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/lint.yml0000644000175000017500000000252615064306076020613 0ustar00eschwartzeschwartzname: Lint concurrency: group: lint-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: paths: - "**.py" - ".github/workflows/lint.yml" - ".pylintrc" - ".flake8" - ".mypy.ini" pull_request: paths: - "**.py" - ".github/workflows/lint.yml" - ".pylintrc" - ".flake8" - ".mypy.ini" permissions: contents: read jobs: pylint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - run: python -m pip install pylint - run: pylint --output-format colorized mesonbuild flake8: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - run: python -m pip install flake8 - run: flake8 --color always mesonbuild/ mypy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' # Pin mypy to version 1.8, so we retain the ability to lint for Python 3.7 - run: python -m pip install "mypy==1.8" strictyaml types-PyYAML types-tqdm types-chevron - run: python run_mypy.py --allver env: PYTHONUNBUFFERED: 1 TERM: xterm-color MYPY_FORCE_COLOR: 1 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/macos.yml0000644000175000017500000001206415064306076020745 0ustar00eschwartzeschwartzname: macos concurrency: group: macos-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: - master # Stable branches such as 0.56 or 1.0 - '[0-9]+.[0-9]+' paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/macos.yml" - "run*tests.py" pull_request: paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/macos.yml" - "run*tests.py" permissions: contents: read jobs: unittests-appleclang: runs-on: macos-latest steps: - uses: actions/checkout@v4 - run: | export PATH="$HOME/Library/Python/3.9/bin:$PATH" /usr/bin/python3 -m pip install --upgrade pip /usr/bin/python3 -m pip install pytest pytest-xdist pytest-subtests fastjsonschema - run: brew install pkg-config ninja llvm qt@5 - env: CPPFLAGS: "-I/opt/homebrew/include" LDFLAGS: "-L/opt/homebrew/lib" MESON_CI_JOBNAME: unittests-appleclang MESON_UNIT_TEST_BACKEND: ninja HOMEBREW_NO_AUTO_UPDATE: 1 # These cannot evaluate anything, so we cannot set PATH or SDKROOT here run: | export SDKROOT="$(xcodebuild -version -sdk macosx Path)" export PATH="$HOME/Library/Python/3.9/bin:$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/llvm/bin:$PATH" export PKG_CONFIG_PATH="/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/Current/lib/pkgconfig:/opt/homebrew/opt/qt@5/lib/pkgconfig:$PKG_CONFIG_PATH" /usr/bin/python3 ./run_unittests.py project-tests-appleclang: runs-on: macos-latest strategy: fail-fast: false matrix: include: - NAME: macos-clang unity: off - NAME: macos-clang-unity unity: on name: ${{ matrix.NAME }} env: MESON_CI_JOBNAME: ${{ matrix.NAME }} HOMEBREW_NO_AUTO_UPDATE: 1 steps: - uses: actions/checkout@v4 # Avoid picking up an older version of LLVM that does not work. - run: brew update # github actions overwrites brew's python. Force it to reassert itself, by running in a separate step. - name: unbreak python in github actions run: | find /usr/local/bin -lname '*/Library/Frameworks/Python.framework/*' -delete sudo rm -rf /Library/Frameworks/Python.framework/ brew install --force python3 && brew unlink python3 && brew unlink python3 && brew link --overwrite python3 # Delete nonsensical PEP 668 breakage. It is the wrong solution to the problem and isn't designed to be # productive -- only victim blaming -- however it bites particularly badly because this is a container/VM # See commit 5c479d7a13a518c18ccb4dc3b6bdd7bfc2a9bdb5 for a more thorough analysis. find /opt/homebrew/Cellar/python* -name EXTERNALLY-MANAGED -print0 | xargs -0 rm -vf # use python3 from homebrew because it is a valid framework, unlike the actions one: # https://github.com/actions/setup-python/issues/58 - run: brew install pkg-config ninja llvm qt@5 boost ldc hdf5 openmpi lapack scalapack sdl2 boost-python3 gtk-doc zstd ncurses objfw libomp - run: | python3 -m pip install cython - env: CPPFLAGS: "-I/opt/homebrew/include" LDFLAGS: "-L/opt/homebrew/lib" MESON_ARGS: --unity=${{ matrix.unity }} XML_CATALOG_FILES: "/opt/homebrew/etc/xml/catalog" CI: 1 # These cannot evaluate anything, so we cannot set PATH or SDKROOT here run: | export SDKROOT="$(xcodebuild -version -sdk macosx Path)" # Append LLVM's bin directory to PATH to prioritise Apple Clang over Homebrew Clang. # We need this to avoid objfw test failures. export PATH="$HOME/tools:/opt/homebrew/opt/qt@5/bin:/opt/homebrew/opt/ncurses/bin:$PATH:/opt/homebrew/opt/llvm/bin" export PKG_CONFIG_PATH="/opt/homebrew/opt/qt@5/lib/pkgconfig:/opt/homebrew/opt/lapack/lib/pkgconfig:/opt/homebrew/opt/ncurses/lib/pkgconfig:$PKG_CONFIG_PATH" ./run_project_tests.py --backend=ninja Qt4macos: # This job only works on Intel Macs, because OpenSSL 1.0 doesn't build on # Apple ARM runs-on: macos-13 env: HOMEBREW_NO_AUTO_UPDATE: 1 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - run: python -m pip install -e . - run: brew install pkg-config ninja gcc - run: brew tap cartr/qt4 - run: brew install qt@4 - run: brew link qt@4 # qt4 tap seems to be broken - run: ln -sfn /usr/local/Cellar/qt@4/4.8.7_6.reinstall /usr/local/Cellar/qt@4/4.8.7_6 - run: meson setup "test cases/frameworks/4 qt" build -Drequired=qt4 - run: meson compile -C build - uses: actions/upload-artifact@v4 if: failure() with: name: Qt4_Mac_build path: build/meson-logs/meson-log.txt - run: meson test -C build -v - uses: actions/upload-artifact@v4 if: failure() with: name: Qt4_Mac_test path: build/meson-logs/testlog.txt ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/msys2.yml0000644000175000017500000000751215064306076020722 0ustar00eschwartzeschwartzname: msys2 concurrency: group: msys2-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: - master # Stable branches such as 0.56 or 1.0 - '[0-9]+.[0-9]+' paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/msys2.yml" - "run*tests.py" pull_request: paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/msys2.yml" - "run*tests.py" permissions: contents: read jobs: test: runs-on: windows-2022 name: ${{ matrix.NAME }} strategy: fail-fast: false matrix: include: - NAME: gccx86ninja MSYSTEM: MINGW32 MSYS2_ARCH: i686 MSYS2_CURSES: ncurses COMPILER: gcc TOOLCHAIN: toolchain - NAME: gccx64ninja MSYSTEM: MINGW64 MSYS2_ARCH: x86_64 MSYS2_CURSES: pdcurses COMPILER: gcc TOOLCHAIN: toolchain - NAME: clangx64ninja MSYSTEM: MINGW64 MSYS2_ARCH: x86_64 MSYS2_CURSES: COMPILER: clang TOOLCHAIN: clang env: MESON_CI_JOBNAME: msys2-${{ matrix.NAME }} defaults: run: shell: msys2 {0} steps: - uses: actions/checkout@v4 - uses: msys2/setup-msys2@v2 with: msystem: ${{ matrix.MSYSTEM }} update: true install: >- base-devel git mercurial lcov wget unzip mingw-w64-${{ matrix.MSYS2_ARCH }}-cmake mingw-w64-${{ matrix.MSYS2_ARCH }}-glib2 mingw-w64-${{ matrix.MSYS2_ARCH }}-libxml2 mingw-w64-${{ matrix.MSYS2_ARCH }}-ninja mingw-w64-${{ matrix.MSYS2_ARCH }}-pkg-config mingw-w64-${{ matrix.MSYS2_ARCH }}-python mingw-w64-${{ matrix.MSYS2_ARCH }}-python-lxml mingw-w64-${{ matrix.MSYS2_ARCH }}-python-setuptools mingw-w64-${{ matrix.MSYS2_ARCH }}-python-pip mingw-w64-${{ matrix.MSYS2_ARCH }}-python-fastjsonschema mingw-w64-${{ matrix.MSYS2_ARCH }}-objfw mingw-w64-${{ matrix.MSYS2_ARCH }}-llvm mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.TOOLCHAIN }} - name: Install dependencies run: | python3 -m pip --disable-pip-version-check install gcovr pefile pytest pytest-subtests pytest-xdist - name: Install pypy3 on x86_64 run: | mkdir pypy3local pushd pypy3local wget -nv https://downloads.python.org/pypy/pypy3.8-v7.3.9-win64.zip unzip pypy3.8-v7.3.9-win64.zip mv pypy3.8-v7.3.9-win64/* ./ popd if: ${{ matrix.MSYS2_ARCH == 'x86_64' }} - name: Run Tests run: | if [[ "${{ matrix.MSYS2_ARCH }}" == "x86_64" ]]; then # There apparently is no clean way to add to the PATH in the # previous step? # See for instance https://github.com/msys2/setup-msys2/issues/171 export PATH=$PATH:$PWD/pypy3local # Make sure it is on the PATH pypy3 -c "import sys; print(sys.version)" fi export PATHEXT="$PATHEXT;.py" if [[ '${{ matrix.COMPILER }}' == 'clang' ]]; then export CC=clang export CXX=clang++ export OBJC=clang export OBJCXX=clang++ fi if [[ "${{ matrix.MSYS2_CURSES }}" != "" ]]; then pacman --noconfirm --needed -S mingw-w64-${{ matrix.MSYS2_ARCH }}-${{ matrix.MSYS2_CURSES }} fi MSYSTEM= python3 ./run_tests.py --backend=ninja - uses: actions/upload-artifact@v4 with: name: ${{ matrix.NAME }} path: meson-test-run.* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/nightly.yml0000644000175000017500000000116115064306076021315 0ustar00eschwartzeschwartzname: Nightly Wheels concurrency: group: wheels cancel-in-progress: true on: push: branches: - master paths: - "mesonbuild/**" permissions: contents: read jobs: wheel: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Build wheel run: | python -m pip install build setuptools_scm python -m build -nwx - name: Upload wheel uses: scientific-python/upload-nightly-action@main with: artifacts_path: dist anaconda_nightly_upload_token: ${{secrets.ANACONDA_ORG_UPLOAD_TOKEN}} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/nonnative.yml0000644000175000017500000000244015064306076021641 0ustar00eschwartzeschwartzname: Cross-only compilation environment concurrency: group: nonnative-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: - master # Stable branches such as 0.56 or 1.0 - '[0-9]+.[0-9]+' paths: - "mesonbuild/**" - "test cases/**" - ".github/workflows/nonnative.yml" - "run*tests.py" pull_request: paths: - "mesonbuild/**" - "test cases/**" - ".github/workflows/nonnative.yml" - "run*tests.py" permissions: contents: read jobs: cross-only-armhf: runs-on: ubuntu-latest container: mesonbuild/eoan:latest env: MESON_CI_JOBNAME: ubuntu-${{ github.job }} steps: - run: | apt-get -y purge clang gcc gdc apt-get -y autoremove - uses: actions/checkout@v4 - name: Run tests run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./run_tests.py $CI_ARGS --cross ubuntu-armhf.json --cross-only' cross-cuda: runs-on: ubuntu-latest container: mesonbuild/cuda-cross:latest env: MESON_CI_JOBNAME: cuda-cross-${{ github.job }} steps: - uses: actions/checkout@v4 - name: Run tests run: bash -c 'source /ci/env_vars.sh; cd $GITHUB_WORKSPACE; ./run_tests.py $CI_ARGS --cross cuda-cross.json --cross-only' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/os_comp.yml0000644000175000017500000001165415064306076021306 0ustar00eschwartzeschwartzname: linux concurrency: group: linux-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: - master # Stable branches such as 0.56 or 1.0 - '[0-9]+.[0-9]+' paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/images.yml" - ".github/workflows/os_comp.yml" - "run*tests.py" pull_request: paths: - "mesonbuild/**" - "test cases/**" - "unittests/**" - ".github/workflows/images.yml" - ".github/workflows/os_comp.yml" - "run*tests.py" permissions: contents: read jobs: arch: name: ${{ matrix.cfg.name }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: cfg: - { name: Arch Linux, id: arch } - { name: CUDA (on Arch), id: cuda } - { name: Fedora, id: fedora } - { name: Gentoo, id: gentoo } - { name: OpenSUSE, id: opensuse } - { name: Ubuntu Bionic, id: bionic } container: image: mesonbuild/${{ matrix.cfg.id }}:latest volumes: - ${{ matrix.cfg.id == 'bionic' && '/node20217:/node20217:rw,rshared' || ' ' }} - ${{ matrix.cfg.id == 'bionic' && '/node20217:/__e/node20:ro,rshared' || ' ' }} env: MESON_CI_JOBNAME: linux-${{ matrix.cfg.id }}-gcc steps: - name: install nodejs20glibc2.17 if: ${{ matrix.cfg.id == 'bionic' }} run: | apt install curl -y curl -LO https://unofficial-builds.nodejs.org/download/release/v20.9.0/node-v20.9.0-linux-x64-glibc-217.tar.xz tar -xf node-v20.9.0-linux-x64-glibc-217.tar.xz --strip-components 1 -C /node20217 ldd /__e/node20/bin/node - uses: actions/checkout@v4 - name: Run tests # All environment variables are stored inside the docker image in /ci/env_vars.sh # They are defined in the `env` section in each image.json. CI_ARGS should be set # via the `args` array ub the image.json shell: bash run: | # dmd is installed under /root on OpenSUSE [[ ${{ matrix.cfg.id }} == opensuse ]] && export HOME=/root source /ci/env_vars.sh cd $GITHUB_WORKSPACE ./run_tests.py $CI_ARGS pypy: name: 'Arch / PyPy' runs-on: ubuntu-latest container: mesonbuild/arch:latest env: MESON_CI_JOBNAME_UPDATE: linux-arch-gcc-pypy steps: - uses: actions/checkout@v4 - name: Run tests run: | source /ci/env_vars.sh export MESON_CI_JOBNAME=$MESON_CI_JOBNAME_UPDATE pypy3 run_tests.py ubuntu-rolling: name: 'Ubuntu Rolling' runs-on: ubuntu-latest strategy: fail-fast: false matrix: cfg: - CC: 'gcc' CXX: 'g++' - MESON_ARGS: '--unity=on -Ddefault_library=static' RUN_TESTS_ARGS: '--no-unittests' CC: 'gcc' CXX: 'g++' - MESON_ARGS: '-Ddefault_library=both' RUN_TESTS_ARGS: '--no-unittests' CC: 'gcc' CXX: 'g++' - CC: 'clang' CXX: 'clang++' - MESON_ARGS: '--unity=on' RUN_TESTS_ARGS: '--no-unittests' CC: 'clang' CXX: 'clang++' - RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json' MESON_RSP_THRESHOLD: '0' CC: 'gcc' CXX: 'g++' - RUN_TESTS_ARGS: '--cross ubuntu-armhf.json --cross linux-mingw-w64-64bit.json' MESON_ARGS: '--unity=on' CC: 'gcc' CXX: 'g++' env: MESON_CI_JOBNAME_UPDATE: linux-${{ github.job }}-${{ matrix.cfg.CC }} container: image: mesonbuild/ubuntu-rolling env: MESON_RSP_THRESHOLD: ${{ matrix.cfg.MESON_RSP_THRESHOLD }} MESON_ARGS: ${{ matrix.cfg.MESON_ARGS }} RUN_TESTS_ARGS: ${{ matrix.cfg.RUN_TESTS_ARGS }} CC: ${{ matrix.cfg.CC }} CXX: ${{ matrix.cfg.CXX }} steps: - name: Checkout code uses: actions/checkout@v4 - name: Run tests shell: bash run: | export HOME=/root export CC=$CC export CXX=$CXX export OBJC=$CC export OBJCXX=$CXX export PATH=$(pwd)/tools:$PATH if test "$MESON_RSP_THRESHOLD" != "" then export MESON_RSP_THRESHOLD=$MESON_RSP_THRESHOLD fi source /ci/env_vars.sh export MESON_CI_JOBNAME=$MESON_CI_JOBNAME_UPDATE update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix update-alternatives --set i686-w64-mingw32-g++ /usr/bin/i686-w64-mingw32-g++-posix ./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/stable_builddir.yml0000644000175000017500000000176315064306076022777 0ustar00eschwartzeschwartzname: stable build directories on: push: branches: - '[0-9]+.[0-9]+' permissions: contents: read jobs: regression: runs-on: ubuntu-latest env: TESTDIR: "manual tests/13 builddir upgrade" steps: - uses: actions/checkout@v4 - name: install ninja run: sudo apt-get -y install build-essential ninja-build - name: Fetch tags and unshallow run: git fetch --unshallow --tags - name: Checkout latest release on this branch run: | cp -r "$TESTDIR" "$TESTDIR"-temp git checkout "$(git describe --abbrev=0)" - name: Configure with most recent tag run: ./meson.py setup "$TESTDIR"-temp builddir - name: Return to testing commit run: git checkout $GITHUB_SHA - name: check that everything still works run: | ./meson.py compile -C builddir ninja -C builddir test DESTDIR=pkg ninja -C builddir install ./meson.py introspect builddir --all ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/unusedargs_missingreturn.yml0000644000175000017500000000366115064306076025017 0ustar00eschwartzeschwartzname: UnusedMissingReturn # this workflow checks for # * unused input arguments # * missing return values # * strict prototypes # some users have default configs that will needlessly fail Meson self-tests due to these syntax. env: CFLAGS: "-Werror=unused-parameter -Werror=return-type -Werror=strict-prototypes" CPPFLAGS: "-Werror=unused-parameter -Werror=return-type" FFLAGS: "-fimplicit-none" concurrency: group: unusedargs-${{ github.head_ref || github.ref }} cancel-in-progress: true on: push: paths: - ".github/workflows/unusedargs_missingreturn.yml" - "test cases/cmake/**" - "test cases/common/**" - "test cases/fortran/**" - "test cases/linuxlike/**" - "test cases/objc/**" - "test cases/objcpp/**" - "test cases/windows/**" pull_request: paths: - ".github/workflows/unusedargs_missingreturn.yml" - "test cases/cmake/**" - "test cases/common/**" - "test cases/fortran/**" - "test cases/linuxlike/**" - "test cases/objc/**" - "test cases/objcpp/**" - "test cases/windows/**" permissions: contents: read jobs: linux: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - name: Install Compilers run: | sudo apt update -yq sudo apt install -yq --no-install-recommends g++ gfortran ninja-build gobjc gobjc++ - run: ./run_project_tests.py --only cmake common fortran platform-linux "objective c" "objective c++" env: MESON_CI_JOBNAME: linux-ubuntu-gcc-werror windows: runs-on: windows-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-python@v5 with: python-version: '3.x' - run: pip install ninja pefile - run: python ./run_project_tests.py --only platform-windows env: CC: gcc CXX: g++ FC: gfortran MESON_CI_JOBNAME: msys2-gcc-werror ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.github/workflows/website.yml0000644000175000017500000000536015064306076021306 0ustar00eschwartzeschwartzname: Update website concurrency: group: mesonbuild.com # We do NOT want `cancel-in-progress` here since only one website job # should run at a time to avoid upload race conditions. on: push: branches: - master paths: - .github/workflows/website.yml - docs/** pull_request: paths: - .github/workflows/website.yml - docs/** workflow_dispatch: release: types: - published permissions: contents: write # for release creation (svenstaro/upload-release-action) # This job is copy/paster into wrapdb CI, please update it there when doing any # change here. jobs: update_website: env: HAS_SSH_KEY: ${{ secrets.WEBSITE_PRIV_KEY != '' }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/cache/restore@v4 id: restore-cache with: # should use 'pip3 cache dir' to discover this path path: ~/.cache/pip key: website-pip-${{ github.run_number }} restore-keys: website-pip- - name: Install package run: | sudo apt-get -y install python3-pip ninja-build libjson-glib-dev pip install hotdoc chevron strictyaml aiohttp - uses: actions/cache/save@v4 with: # should use 'pip3 cache dir' to discover this path path: ~/.cache/pip key: website-pip-${{ github.run_number }} - name: Setup SSH Keys and known_hosts env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | ssh-agent -a $SSH_AUTH_SOCK > /dev/null ssh-add - <<< "${{ secrets.WEBSITE_PRIV_KEY }}" if: github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' - name: Build website run: | git config --global user.name "github-actions" git config --global user.email "github-actions@github.com" cd docs ../meson.py setup _build ninja -C _build ninja -C _build test - name: Update website env: SSH_AUTH_SOCK: /tmp/ssh_agent.sock run: | cd docs ninja -C _build upload if: github.ref == 'refs/heads/master' && env.HAS_SSH_KEY == 'true' - name: Release the current JSON docs uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: docs/_build/reference_manual.json tag: ${{ github.ref }} if: ${{ github.event_name == 'release' }} - name: Release the current man docs uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} file: docs/_build/meson-reference.3 tag: ${{ github.ref }} if: ${{ github.event_name == 'release' }} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.mailmap0000644000175000017500000000175615064306076015152 0ustar00eschwartzeschwartzAlexandre Foley AlexandreFoley Igor Gnatenko Igor Gnatenko Jussi Pakkanen Jussi Pakkanen Jussi Pakkanen Jussi Pakkanen Jussi Pakkanen jpakkane Liam Beguin Liam Beguin Nirbheek Chauhan Nirbheek Chauhan Nicolas Schneider Nicolas Schneider Patrick Griffis TingPing Thibault Saunier Thibault Saunier Thibault Saunier Saunier Thibault Tim-Philipp Müller Tim-Philipp Müller ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.mypy.ini0000644000175000017500000000147415064306076015303 0ustar00eschwartzeschwartz[mypy] strict_optional = False show_error_context = False show_column_numbers = True ignore_missing_imports = False implicit_reexport = False follow_imports = silent warn_redundant_casts = True warn_unused_ignores = True warn_return_any = True # warn_unreachable = True disallow_untyped_calls = True disallow_untyped_defs = True disallow_incomplete_defs = True disallow_untyped_decorators = True no_implicit_optional = True strict_equality = True check_untyped_defs = True # disallow_any_expr = True # disallow_any_decorated = True # disallow_any_explicit = True # disallow_any_generics = True # disallow_subclassing_any = True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/.pylintrc0000644000175000017500000000377015064306076015374 0ustar00eschwartzeschwartz[MASTER] jobs=0 load-plugins= pylint.extensions.bad_builtin, pylint.extensions.set_membership, [REPORTS] score=no [MESSAGES CONTROL] disable= abstract-method, arguments-differ, arguments-renamed, attribute-defined-outside-init, broad-except, cell-var-from-loop, consider-using-f-string, consider-using-with, contextmanager-generator-missing-cleanup, cyclic-import, deprecated-decorator, duplicate-code, duplicate-value, exec-used, fixme, import-error, import-outside-toplevel, inconsistent-mro, inconsistent-return-statements, invalid-name, invalid-unary-operand-type, line-too-long, method-cache-max-size-none, missing-class-docstring, missing-function-docstring, missing-module-docstring, multiple-imports, multiple-statements, no-else-break, no-else-continue, no-else-raise, no-else-return, no-member, no-name-in-module, no-self-argument, non-parent-init-called, not-an-iterable, not-callable, pointless-string-statement, possibly-used-before-assignment, protected-access, raise-missing-from, redeclared-assigned-name, redefined-argument-from-local, redefined-builtin, redefined-outer-name, subprocess-run-check, super-init-not-called, too-few-public-methods, too-many-ancestors, too-many-arguments, too-many-boolean-expressions, too-many-branches, too-many-instance-attributes, too-many-lines, too-many-locals, too-many-nested-blocks, too-many-positional-arguments, too-many-public-methods, too-many-return-statements, too-many-statements, typevar-name-incorrect-variance, undefined-loop-variable, unidiomatic-typecheck, unnecessary-dict-index-lookup, unnecessary-lambda-assignment, unsubscriptable-object, unused-argument, unused-variable, used-before-assignment, useless-super-delegation, wrong-import-order, wrong-import-position, ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/CODEOWNERS0000644000175000017500000000065115064306076015115 0ustar00eschwartzeschwartz* @jpakkane /mesonbuild/modules/pkgconfig.py @xclaesse /mesonbuild/modules/cmake.py @mensinda /mesonbuild/modules/unstable_external_project.py @xclaesse /mesonbuild/modules/unstable_rust.py @dcbaker /mesonbuild/modules/unstable_wayland.py @markbolhuis /mesonbuild/ast/ @mensinda /mesonbuild/cmake/ @mensinda /mesonbuild/compilers/ @dcbaker /mesonbuild/linkers.py @dcbaker /mesonbuild/mtest.py @bonzini /docs/refman @mensinda ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/COPYING0000644000175000017500000002613615064306076014563 0ustar00eschwartzeschwartz Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/MANIFEST.in0000644000175000017500000000052415064306076015257 0ustar00eschwartzeschwartzgraft test?cases graft manual?tests graft cross graft data graft graphics graft man graft tools graft packaging graft unittests include contributing.md include COPYING include README.md include run_cross_test.py include run_tests.py include run_unittests.py include run_meson_command_tests.py include run_project_tests.py include meson.py ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.7455683 meson-1.9.1/PKG-INFO0000644000175000017500000000344515064306101014610 0ustar00eschwartzeschwartzMetadata-Version: 2.4 Name: meson Version: 1.9.1 Summary: A high performance build system Home-page: https://mesonbuild.com Author: Jussi Pakkanen Author-email: jpakkane@gmail.com License: Apache License, Version 2.0 Project-URL: Source, https://github.com/mesonbuild/meson Keywords: meson,mesonbuild,build system,cmake Classifier: Development Status :: 5 - Production/Stable Classifier: Environment :: Console Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License Classifier: Natural Language :: English Classifier: Operating System :: MacOS :: MacOS X Classifier: Operating System :: Microsoft :: Windows Classifier: Operating System :: POSIX :: BSD Classifier: Operating System :: POSIX :: Linux Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Topic :: Software Development :: Build Tools Requires-Python: >=3.7 License-File: COPYING Provides-Extra: ninja Requires-Dist: ninja>=1.8.2; extra == "ninja" Provides-Extra: progress Requires-Dist: tqdm; extra == "progress" Provides-Extra: typing Requires-Dist: mypy; extra == "typing" Requires-Dist: typing_extensions; python_version < "3.8" and extra == "typing" Dynamic: license-file Meson is a cross-platform build system designed to be both as fast and as user friendly as possible. It supports many languages and compilers, including GCC, Clang, PGI, Intel, and Visual Studio. Its build definitions are written in a simple non-Turing complete DSL. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/README.md0000644000175000017500000000641315064306076015003 0ustar00eschwartzeschwartz

Meson® is a project to create the best possible next-generation build system. #### Status [![PyPI](https://img.shields.io/pypi/v/meson.svg)](https://pypi.python.org/pypi/meson) [![Build Status](https://dev.azure.com/jussi0947/jussi/_apis/build/status/mesonbuild.meson)](https://dev.azure.com/jussi0947/jussi/_build/latest?definitionId=1) [![Codecov](https://codecov.io/gh/mesonbuild/meson/coverage.svg?branch=master)](https://codecov.io/gh/mesonbuild/meson/branch/master) #### Dependencies - [Python](https://python.org) (version 3.7 or newer) - [Ninja](https://ninja-build.org) (version 1.8.2 or newer) Latest Meson version supporting previous Python versions: - Python 3.6: **0.61.5** - Python 3.5: **0.56.2** - Python 3.4: **0.45.1** #### Installing from source Meson is available on [PyPI](https://pypi.python.org/pypi/meson), so it can be installed with `pip3 install meson`. The exact command to type to install with `pip` can vary between systems, be sure to use the Python 3 version of `pip`. If you wish you can install it locally with the standard Python command: ```console python3 -m pip install meson ``` For builds using Ninja, Ninja can be downloaded directly from Ninja [GitHub release page](https://github.com/ninja-build/ninja/releases) or via [PyPI](https://pypi.python.org/pypi/ninja) ```console python3 -m pip install ninja ``` More on Installing Meson build can be found at the [getting meson page](https://mesonbuild.com/Getting-meson.html). #### Creating a standalone script Meson can be run as a [Python zip app](https://docs.python.org/3/library/zipapp.html). To generate the executable run the following command: ./packaging/create_zipapp.py --outfile meson.pyz --interpreter '/usr/bin/env python3' #### Running Meson requires that you have a source directory and a build directory and that these two are different. In your source root must exist a file called `meson.build`. To generate the build system run this command: `meson setup ` Depending on how you obtained Meson the command might also be called `meson.py` instead of plain `meson`. In the rest of this document we are going to use the latter form. You can omit either of the two directories, and Meson will substitute the current directory and autodetect what you mean. This allows you to do things like this: ```console cd meson setup builddir ``` To compile, cd into your build directory and type `ninja`. To run unit tests, type `ninja test`. More on running Meson build system commands can be found at the [running meson page](https://mesonbuild.com/Running-Meson.html) or by typing `meson --help`. #### Contributing We love code contributions. See the [contribution page](https://mesonbuild.com/Contributing.html) on the website for details. #### IRC The channel to use is `#mesonbuild` either via Matrix ([web interface][matrix_web]) or [OFTC IRC][oftc_irc]. [matrix_web]: https://app.element.io/#/room/#mesonbuild:matrix.org [oftc_irc]: https://www.oftc.net/ #### Further info More information about the Meson build system can be found at the [project's home page](https://mesonbuild.com). Meson is a registered trademark of ***Jussi Pakkanen***. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/azure-pipelines.yml0000644000175000017500000000612215064306076017360 0ustar00eschwartzeschwartz# intel oneapi installation is based on the examples at # https://github.com/oneapi-src/oneapi-ci # # and are copyrighted: # # SPDX-FileCopyrightText: 2020 Intel Corporation # SPDX-License-Identifier: MIT # # The rest of this file contains the standard Meson project copyright: # # SPDX-License-Identifer: Apache-2.0 # Copyright 2022 The Meson development team name: $(BuildID) trigger: branches: include: - 'master' # Release branches - '1.*' paths: include: - 'mesonbuild' - 'test cases' - 'unittests' - 'azure-pipelines.yml' - 'ci/run.ps1' - 'run_project_tests.py' - 'run_tests.py' - 'run_unittests.py' pr: autoCancel: true branches: include: - '*' paths: include: - 'mesonbuild' - 'test cases' - 'unittests' - 'azure-pipelines.yml' - 'ci/run.ps1' - 'run_project_tests.py' - 'run_tests.py' - 'run_unittests.py' variables: CI: 1 SOURCE_VERSION: $(Build.SourceVersion) WINDOWS_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/18680/w_HPCKit_p_2022.2.0.173_offline.exe WINDOWS_FORTRAN_COMPONENTS: intel.oneapi.win.ifort-compiler jobs: - job: vs2019 timeoutInMinutes: 120 pool: vmImage: windows-2019 strategy: matrix: vc2019x64ninja: arch: x64 compiler: msvc2019 backend: ninja ifort: true vc2019x64vs: arch: x64 compiler: msvc2019 backend: vs2019 # mysteriously, several tests fail because vs cannot find # executables such as cmd.exe ??? ifort: false vc2019arm64ninjacross: arch: arm64 compiler: msvc2019 backend: ninja extraargs: --cross arm64cl.txt --cross-only # ifort doesn't support arm64 ifort: false steps: - task: Cache@2 inputs: path: C:\Program Files (x86)\Intel\oneAPI key: '"install" | "$(WINDOWS_HPCKIT_URL)" | "$(WINDOWS_FORTRAN_COMPONENTS)" | "compiler" | ci/intel-scripts/cache_exclude_windows.sh' cacheHitVar: CACHE_RESTORED condition: eq(variables.ifort, 'true') - script: ci/intel-scripts/install_windows.bat $(WINDOWS_HPCKIT_URL) $(WINDOWS_FORTRAN_COMPONENTS) displayName: install ifort condition: and(ne(variables.CACHE_RESTORED, 'true'), eq(variables.ifort, 'true')) - bash: ci/intel-scripts/cache_exclude_windows.sh displayName: exclude unused files from cache condition: and(ne(variables.CACHE_RESTORED, 'true'), eq(variables.ifort, 'true')) - script: choco install -y nasm displayName: install NASM - task: UsePythonVersion@0 inputs: versionSpec: '3.7' addToPath: true architecture: 'x64' - task: BatchScript@1 displayName: insert ifort into environment inputs: filename: ci/intel-scripts/activate_windows.bat arguments: vs2019 modifyEnvironment: True condition: eq(variables.ifort, 'true') - task: PowerShell@2 inputs: targetType: 'filePath' filePath: .\ci\run.ps1 env: MESON_CI_JOBNAME: azure-$(System.JobName) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1758563392.316504 meson-1.9.1/ci/0000755000175000017500000000000015064306100014077 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3166566 meson-1.9.1/ci/ciimage/0000755000175000017500000000000015064306100015475 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3168178 meson-1.9.1/ci/ciimage/arch/0000755000175000017500000000000015064306100016412 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/arch/image.json0000644000175000017500000000015715064306076020406 0ustar00eschwartzeschwartz{ "base_image": "archlinux:latest", "env": { "CI": "1", "MESON_CI_JOBNAME": "linux-arch-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/arch/install.sh0000755000175000017500000000367015064306076020441 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh # Inspired by https://github.com/greyltc/docker-archlinux-aur/blob/master/add-aur.sh pkgs=( python python-pip pypy3 ninja make git sudo fakeroot autoconf automake patch libelf gcc gcc-fortran gcc-objc vala rust bison flex cython go dlang-dmd mono boost qt5-base gtkmm3 gtest gmock protobuf gobject-introspection itstool glib2-devel gtk3 java-environment=8 gtk-doc llvm clang sdl2 graphviz doxygen vulkan-headers vulkan-icd-loader vulkan-validation-layers openssh mercurial gtk-sharp-2 qt5-tools libwmf cmake netcdf-fortran openmpi nasm gnustep-base gettext python-lxml hotdoc rust-bindgen qt6-base qt6-tools qt6-declarative wayland wayland-protocols intel-oneapi-mkl # cuda ) aur_pkgs=(scalapack wxwidgets-gtk2) cleanup_pkgs=(go) AUR_USER=docker PACMAN_OPTS='--needed --noprogressbar --noconfirm' # Workaround for cmake-4.0 vs wxwidgets-gtk2 export CMAKE_POLICY_VERSION_MINIMUM=3.5 # Patch config files sed -i 's/#Color/Color/g' /etc/pacman.conf sed -i 's,#MAKEFLAGS="-j2",MAKEFLAGS="-j$(nproc)",g' /etc/makepkg.conf sed -i "s,PKGEXT='.pkg.tar.zst',PKGEXT='.pkg.tar',g" /etc/makepkg.conf # Install packages pacman -Syu $PACMAN_OPTS "${pkgs[@]}" install_python_packages pypy3 -m ensurepip pypy3 -m pip install "${base_python_pkgs[@]}" # Setup the user useradd -m $AUR_USER echo "${AUR_USER}:" | chpasswd -e echo "$AUR_USER ALL = NOPASSWD: ALL" >> /etc/sudoers # fix installing packages from source, attempting to install debug info sed -i '/OPTIONS/{s|debug|!debug|}' /etc/makepkg.conf # Install yay su $AUR_USER -c 'cd; git clone https://aur.archlinux.org/yay.git' su $AUR_USER -c 'cd; cd yay; makepkg' pushd /home/$AUR_USER/yay/ pacman -U *.pkg.tar --noprogressbar --noconfirm popd rm -rf /home/$AUR_USER/yay # Install yay deps su $AUR_USER -c "yay -S $PACMAN_OPTS ${aur_pkgs[*]}" # cleanup pacman -Rs --noconfirm "${cleanup_pkgs[@]}" su $AUR_USER -c "yes | yay -Scc" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3169665 meson-1.9.1/ci/ciimage/bionic/0000755000175000017500000000000015064306100016740 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/bionic/image.json0000644000175000017500000000017715064306076020736 0ustar00eschwartzeschwartz{ "base_image": "ubuntu:bionic", "env": { "CI": "1", "DC": "gdc", "MESON_CI_JOBNAME": "linux-bionic-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/bionic/install.sh0000755000175000017500000000341215064306076020761 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh export DEBIAN_FRONTEND=noninteractive export LANG='C.UTF-8' export DC=gdc pkgs=( python3-pip libxml2-dev libxslt1-dev libyaml-dev libjson-glib-dev python3.7 python3.7-dev wget unzip cmake doxygen clang pkg-config-arm-linux-gnueabihf qt4-linguist-tools qt5-default qtbase5-private-dev python-dev libomp-dev llvm lcov ldc libclang-dev libgcrypt20-dev libgpgme-dev libhdf5-dev openssh-server libboost-python-dev libboost-regex-dev libblocksruntime-dev libperl-dev libscalapack-mpi-dev libncurses-dev itstool openjdk-11-jre ) boost_pkgs=(atomic chrono date-time filesystem log regex serialization system test thread) sed -i '/^#\sdeb-src /s/^#//' "/etc/apt/sources.list" apt-get -y update apt-get -y upgrade apt-get -y install eatmydata # Base stuff eatmydata apt-get -y build-dep meson # Add boost packages for i in "${boost_pkgs[@]}"; do for j in "1.62.0" "1.65.1"; do pkgs+=("libboost-${i}${j}") done done # packages eatmydata apt-get -y install "${pkgs[@]}" # Actually select the right python version update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 \ --slave /usr/lib/x86_64-linux-gnu/pkgconfig/python3.pc python3.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python-3.6.pc update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2 \ --slave /usr/lib/x86_64-linux-gnu/pkgconfig/python3.pc python3.pc /usr/lib/x86_64-linux-gnu/pkgconfig/python-3.7.pc python3 -m pip install -U "${base_python_pkgs[@]}" "${python_pkgs[@]}" # Install the ninja 0.10 wget https://github.com/ninja-build/ninja/releases/download/v1.10.0/ninja-linux.zip unzip ninja-linux.zip -d /ci # cleanup apt-get -y remove ninja-build apt-get -y clean apt-get -y autoclean rm ninja-linux.zip ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/build.py0000755000175000017500000002154215064306076017171 0ustar00eschwartzeschwartz#!/usr/bin/env python3 import json import argparse import stat import textwrap import shutil import subprocess from tempfile import TemporaryDirectory from pathlib import Path import typing as T image_namespace = 'mesonbuild' image_def_file = 'image.json' install_script = 'install.sh' class ImageDef: def __init__(self, image_dir: Path) -> None: path = image_dir / image_def_file data = json.loads(path.read_text(encoding='utf-8')) assert isinstance(data, dict) assert all([x in data for x in ['base_image', 'env']]) assert isinstance(data['base_image'], str) assert isinstance(data['env'], dict) self.base_image: str = data['base_image'] self.args: T.List[str] = data.get('args', []) self.env: T.Dict[str, str] = data['env'] class BuilderBase(): def __init__(self, data_dir: Path, temp_dir: Path) -> None: self.data_dir = data_dir self.temp_dir = temp_dir self.common_sh = self.data_dir.parent / 'common.sh' self.common_sh = self.common_sh.resolve(strict=True) self.validate_data_dir() self.image_def = ImageDef(self.data_dir) self.docker = shutil.which('docker') self.git = shutil.which('git') if self.docker is None: raise RuntimeError('Unable to find docker') if self.git is None: raise RuntimeError('Unable to find git') def validate_data_dir(self) -> None: files = [ self.data_dir / image_def_file, self.data_dir / install_script, ] if not self.data_dir.exists(): raise RuntimeError(f'{self.data_dir.as_posix()} does not exist') for i in files: if not i.exists(): raise RuntimeError(f'{i.as_posix()} does not exist') if not i.is_file(): raise RuntimeError(f'{i.as_posix()} is not a regular file') class Builder(BuilderBase): def gen_bashrc(self) -> None: out_file = self.temp_dir / 'env_vars.sh' out_data = '' # run_tests.py parameters self.image_def.env['CI_ARGS'] = ' '.join(self.image_def.args) for key, val in self.image_def.env.items(): out_data += f'export {key}="{val}"\n' # Also add /ci to PATH out_data += 'export PATH="/ci:$PATH"\n' out_data += ''' if [ -f "$HOME/.cargo/env" ]; then source "$HOME/.cargo/env" fi ''' out_file.write_text(out_data, encoding='utf-8') # make it executable mode = out_file.stat().st_mode out_file.chmod(mode | stat.S_IEXEC) def gen_dockerfile(self) -> None: out_file = self.temp_dir / 'Dockerfile' out_data = textwrap.dedent(f'''\ FROM {self.image_def.base_image} ADD install.sh /ci/install.sh ADD common.sh /ci/common.sh ADD env_vars.sh /ci/env_vars.sh RUN /ci/install.sh ''') out_file.write_text(out_data, encoding='utf-8') def do_build(self) -> None: # copy files for i in self.data_dir.iterdir(): shutil.copy(str(i), str(self.temp_dir)) shutil.copy(str(self.common_sh), str(self.temp_dir)) self.gen_bashrc() self.gen_dockerfile() cmd_git = [self.git, 'rev-parse', '--short', 'HEAD'] res = subprocess.run(cmd_git, cwd=self.data_dir, stdout=subprocess.PIPE) if res.returncode != 0: raise RuntimeError('Failed to get the current commit hash') commit_hash = res.stdout.decode().strip() cmd = [ self.docker, 'build', '-t', f'{image_namespace}/{self.data_dir.name}:latest', '-t', f'{image_namespace}/{self.data_dir.name}:{commit_hash}', '--pull', self.temp_dir.as_posix(), ] if subprocess.run(cmd).returncode != 0: raise RuntimeError('Failed to build the docker image') class ImageTester(BuilderBase): def __init__(self, data_dir: Path, temp_dir: Path, ci_root: Path) -> None: super().__init__(data_dir, temp_dir) self.meson_root = ci_root.parent.parent.resolve() def gen_dockerfile(self) -> None: out_file = self.temp_dir / 'Dockerfile' out_data = textwrap.dedent(f'''\ FROM {image_namespace}/{self.data_dir.name} ADD meson /meson ''') out_file.write_text(out_data, encoding='utf-8') def copy_meson(self) -> None: shutil.copytree( self.meson_root, self.temp_dir / 'meson', symlinks=True, ignore=shutil.ignore_patterns( '.git', '*_cache', '__pycache__', # 'work area', self.temp_dir.name, ), ) def do_test(self, tty: bool = False) -> None: self.copy_meson() self.gen_dockerfile() try: build_cmd = [ self.docker, 'build', '-t', 'meson_test_image', self.temp_dir.as_posix(), ] if subprocess.run(build_cmd).returncode != 0: raise RuntimeError('Failed to build the test docker image') test_cmd = [] if tty: test_cmd = [ self.docker, 'run', '--rm', '-t', '-i', 'meson_test_image', '/bin/bash', '-c', '' + 'cd meson;' + 'source /ci/env_vars.sh;' + f'echo -e "\\n\\nInteractive test shell in the {image_namespace}/{self.data_dir.name} container with the current meson tree";' + 'echo -e "The file ci/ciimage/user.sh will be sourced if it exists to enable user specific configurations";' + 'echo -e "Run the following command to run all CI tests: ./run_tests.py $CI_ARGS\\n\\n";' + '[ -f ci/ciimage/user.sh ] && exec /bin/bash --init-file ci/ciimage/user.sh;' + 'exec /bin/bash;' ] else: test_cmd = [ self.docker, 'run', '--rm', '-t', 'meson_test_image', '/bin/bash', '-xc', 'source /ci/env_vars.sh; cd meson; ./run_tests.py $CI_ARGS' ] if subprocess.run(test_cmd).returncode != 0 and not tty: raise RuntimeError('Running tests failed') finally: cleanup_cmd = [self.docker, 'rmi', '-f', 'meson_test_image'] subprocess.run(cleanup_cmd).returncode class ImageTTY(BuilderBase): def __init__(self, data_dir: Path, temp_dir: Path, ci_root: Path) -> None: super().__init__(data_dir, temp_dir) self.meson_root = ci_root.parent.parent.resolve() def do_run(self) -> None: try: tty_cmd = [ self.docker, 'run', '--name', 'meson_test_container', '-t', '-i', '-v', f'{self.meson_root.as_posix()}:/meson', f'{image_namespace}/{self.data_dir.name}', '/bin/bash', '-c', '' + 'cd meson;' + 'source /ci/env_vars.sh;' + f'echo -e "\\n\\nInteractive test shell in the {image_namespace}/{self.data_dir.name} container with the current meson tree";' + 'echo -e "The file ci/ciimage/user.sh will be sourced if it exists to enable user specific configurations";' + 'echo -e "Run the following command to run all CI tests: ./run_tests.py $CI_ARGS\\n\\n";' + '[ -f ci/ciimage/user.sh ] && exec /bin/bash --init-file ci/ciimage/user.sh;' + 'exec /bin/bash;' ] subprocess.run(tty_cmd).returncode != 0 finally: cleanup_cmd = [self.docker, 'rm', '-f', 'meson_test_container'] subprocess.run(cleanup_cmd).returncode def main() -> None: parser = argparse.ArgumentParser(description='Meson CI image builder') parser.add_argument('what', type=str, help='Which image to build / test') parser.add_argument('-t', '--type', choices=['build', 'test', 'testTTY', 'TTY'], help='What to do', required=True) args = parser.parse_args() ci_root = Path(__file__).parent ci_data = ci_root / args.what with TemporaryDirectory(prefix=f'{args.type}_{args.what}_', dir=ci_root) as td: ci_build = Path(td) print(f'Build dir: {ci_build}') if args.type == 'build': builder = Builder(ci_data, ci_build) builder.do_build() elif args.type == 'test': tester = ImageTester(ci_data, ci_build, ci_root) tester.do_test() elif args.type == 'testTTY': tester = ImageTester(ci_data, ci_build, ci_root) tester.do_test(tty=True) elif args.type == 'TTY': tester = ImageTTY(ci_data, ci_build, ci_root) tester.do_run() if __name__ == '__main__': main() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/common.sh0000644000175000017500000000143715064306076017342 0ustar00eschwartzeschwartz#!/bin/bash ### ### Common functions for CI builder files. ### All functions can be accessed in install.sh via: ### ### $ source /ci/common.sh ### set -e set -x base_python_pkgs=( pytest pytest-xdist pytest-subtests coverage fastjsonschema ) python_pkgs=( cython gobject PyGObject lxml gcovr ) dub_fetch() { set +e for (( i=1; i<=24; ++i )); do dub fetch "$@" (( $? == 0 )) && break echo "Dub Fetch failed. Retrying in $((i*5))s" sleep $((i*5)) done set -e } install_minimal_python_packages() { rm -f /usr/lib*/python3.*/EXTERNALLY-MANAGED python3 -m pip install "${base_python_pkgs[@]}" $* } install_python_packages() { rm -f /usr/lib*/python3.*/EXTERNALLY-MANAGED python3 -m pip install "${base_python_pkgs[@]}" "${python_pkgs[@]}" $* } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3171353 meson-1.9.1/ci/ciimage/cuda/0000755000175000017500000000000015064306100016411 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/cuda/image.json0000644000175000017500000000021515064306076020400 0ustar00eschwartzeschwartz{ "base_image": "archlinux:latest", "args": ["--only", "cuda"], "env": { "CI": "1", "MESON_CI_JOBNAME": "linux-cuda-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/cuda/install.sh0000755000175000017500000000061415064306076020433 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh pkgs=( python python-pip python-setuptools ninja gcc gcc-objc git cmake cuda zlib pkgconf ) PACMAN_OPTS='--needed --noprogressbar --noconfirm' pacman -Syu $PACMAN_OPTS "${pkgs[@]}" install_minimal_python_packages # Manually remove cache to avoid GitHub space restrictions rm -rf /var/cache/pacman echo "source /etc/profile" >> /ci/env_vars.sh ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3172913 meson-1.9.1/ci/ciimage/cuda-cross/0000755000175000017500000000000015064306100017540 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/cuda-cross/image.json0000644000175000017500000000025115064306076021527 0ustar00eschwartzeschwartz{ "base_image": "ubuntu:22.04", "args": ["--only", "cuda", "--cross", "cuda-cross.json"], "env": { "CI": "1", "MESON_CI_JOBNAME": "linux-cuda-cross" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/cuda-cross/install.sh0000755000175000017500000000177215064306076021570 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh export DEBIAN_FRONTEND=noninteractive export LANG='C.UTF-8' apt-get -y update apt-get -y upgrade apt-get -y install wget # Cuda repo + keyring. wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb apt-get -y install ./cuda-keyring_1.1-1_all.deb # Cuda cross repo. echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/cross-linux-aarch64/ /" \ > /etc/apt/sources.list.d/cuda-ubuntu2204-cross-linux-aarch64.list apt-get -y update pkgs=( clang cmake crossbuild-essential-arm64 cuda-cross-aarch64 cuda-nvcc-12-9 git libglib2.0-dev ninja-build pkg-config python3-pip ) apt-get -y install "${pkgs[@]}" install_minimal_python_packages # Tests need nvcc in PATH in order to run cuda tests. echo "export PATH=\$PATH:/usr/local/cuda/bin" >> /ci/env_vars.sh # cleanup apt-get -y clean apt-get -y autoclean rm cuda-keyring_1.1-1_all.deb ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3174577 meson-1.9.1/ci/ciimage/fedora/0000755000175000017500000000000015064306100016735 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/fedora/image.json0000644000175000017500000000023315064306076020724 0ustar00eschwartzeschwartz{ "base_image": "fedora:latest", "env": { "CI": "1", "SKIP_STATIC_BOOST": "1", "MESON_CI_JOBNAME": "linux-fedora-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/fedora/install.sh0000755000175000017500000000314115064306076020755 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh pkgs=( python python-pip python3-devel ninja-build make git autoconf automake patch file elfutils gcc gcc-c++ gcc-fortran gcc-objc gcc-objc++ vala rust bison flex ldc libasan libasan-static mono-core boost-devel gtkmm30 gtest-devel gmock-devel protobuf-devel wxGTK-devel gobject-introspection boost-python3-devel itstool gtk3-devel java-latest-openjdk-devel gtk-doc llvm-devel clang-devel SDL2-devel graphviz-devel zlib zlib-devel zlib-static #hdf5-openmpi-devel hdf5-devel netcdf-openmpi-devel netcdf-devel netcdf-fortran-openmpi-devel netcdf-fortran-devel scalapack-openmpi-devel doxygen vulkan-devel vulkan-validation-layers-devel openssh lksctp-tools-devel objfw mercurial gtk-sharp2-devel libpcap-devel gpgme-devel qt5-qtbase-devel qt5-qttools-devel qt5-linguist qt5-qtbase-private-devel qt6-qtdeclarative-devel qt6-qtbase-devel qt6-qttools-devel qt6-linguist qt6-qtbase-private-devel libwmf-devel valgrind cmake openmpi-devel nasm gnustep-base-devel gettext-devel ncurses-devel libxml2-devel libxslt-devel libyaml-devel glib2-devel json-glib-devel libgcrypt-devel wayland-devel wayland-protocols-devel # HACK: remove npm once we switch back to hotdoc sdist nodejs-npm ) # Sys update dnf -y upgrade # Install deps dnf -y install "${pkgs[@]}" # HACK: build hotdoc from git repo since current sdist is broken on modern compilers # change back to 'hotdoc' once it's fixed install_python_packages git+https://github.com/hotdoc/hotdoc # HACK: uninstall npm after building hotdoc, remove when we remove npm dnf -y remove nodejs-npm # Cleanup dnf -y clean all ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3176095 meson-1.9.1/ci/ciimage/gentoo/0000755000175000017500000000000015064306100016770 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/gentoo/image.json0000644000175000017500000000022415064306076020757 0ustar00eschwartzeschwartz{ "base_image": "gentoo/stage3:desktop", "env": { "CI": "1", "MESON_CI_JOBNAME": "linux-gentoo-gcc", "SKIP_STATIC_BOOST": "1" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/gentoo/install.sh0000755000175000017500000001143115064306076021011 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh # We divide the package list into 'pkgs_stable' and 'pkgs_latest'. The trade-off # is that latest stuff may not have a binpkg available, but of course we get # better test coverage with the bleeding edge then. pkgs_stable=( app-portage/portage-utils dev-build/cmake dev-vcs/git # language support dev-python/cython dev-python/lxml dev-python/pip virtual/fortran dev-lang/nasm dev-lang/vala dev-lang/python:2.7 dev-java/openjdk-bin dev-util/bindgen dev-libs/elfutils dev-util/gdbus-codegen dev-libs/gobject-introspection dev-util/itstool dev-libs/protobuf # custom deps net-libs/libpcap dev-util/gtk-doc media-libs/libwmf sys-cluster/openmpi sci-libs/netcdf media-libs/libsdl2 dev-cpp/gtest sci-libs/hdf5 dev-qt/linguist-tools sys-devel/llvm dev-qt/qttools # misc app-admin/sudo app-text/doxygen sys-devel/bison sys-devel/gettext # TODO: vulkan-validation-layers # TODO: cuda #dev-cpp/gtkmm:3.0 #dev-java/openjdk-bin:8 #dev-lang/go #dev-lang/mono #dev-lang/python #dev-lang/rust-bin #dev-libs/wayland #dev-libs/wayland-protocols #dev-python/pypy3 #dev-qt/qtbase:6 #dev-qt/qtcore:5 #dev-qt/qttools:6 #dev-vcs/mercurial #gnustep-base/gnustep-base #media-gfx/graphviz #sci-libs/netcdf-fortran #sys-devel/clang #x11-libs/gtk+:3 ) pkgs_latest=( # ~arch boost needed for py3.12 for now (needs 1.84) dev-build/b2 dev-libs/boost dev-build/autoconf dev-build/automake # ~arch only sci-libs/scalapack ) pkgs=( "${pkgs_stable[@]}" "${pkgs_latest[@]}" ) emerge-webrsync --quiet # This means we can't really take advantage of the binhost but a lot of the # advantages of using Gentoo in CI come from the bleeding edge side. # With full ~arch, we don't get binpkgs for much at all. Instead, let's just # do ~arch for the test deps we have. #echo 'ACCEPT_KEYWORDS="~amd64"' >> /etc/portage/make.conf printf "%s\n" ${pkgs[@]} >> /var/lib/portage/world printf "%s\n" ${pkgs_latest[@]} >> /etc/portage/package.accept_keywords/meson cat /etc/portage/package.accept_keywords/meson cat <<-EOF > /etc/portage/package.accept_keywords/misc dev-lang/python-exec dev-lang/python EOF mkdir /etc/portage/binrepos.conf || true mkdir /etc/portage/profile || true cat <<-EOF > /etc/portage/package.use/ci dev-cpp/gtkmm X dev-lang/rust clippy rustfmt dev-lang/rust-bin clippy rustfmt dev-libs/boost python # Some of these settings are needed just to get the binpkg but # aren't negative to have anyway sys-devel/gcc ada d jit >=sys-devel/gcc-13 ada objc objc++ sys-devel/gcc pgo lto sys-libs/zlib static-libs EOF cat <<-EOF >> /etc/portage/make.conf EMERGE_DEFAULT_OPTS="--complete-graph --quiet=y --quiet-build=y --jobs=$(nproc) --load-average=$(nproc)" EMERGE_DEFAULT_OPTS="\${EMERGE_DEFAULT_OPTS} --autounmask-write --autounmask-continue --autounmask-keep-keywords=y --autounmask-use=y" EMERGE_DEFAULT_OPTS="\${EMERGE_DEFAULT_OPTS} --binpkg-respect-use=y" # prevent painfully verbose Github Actions logs. FETCHCOMMAND='wget --no-show-progress -t 3 -T 60 --passive-ftp -O "\\\${DISTDIR}/\\\${FILE}" "\\\${URI}"' # Fortran is no longer enabled by default in 23.0, but we do need and use it. USE="\${USE} fortran" FEATURES="\${FEATURES} parallel-fetch parallel-install -merge-sync" FEATURES="\${FEATURES} getbinpkg binpkg-request-signature" # These don't work in Docker, so reduce noise in logs FEATURES="\${FEATURES} -ipc-sandbox -network-sandbox -pid-sandbox" EOF # TODO: Enable all Pythons / add multiple jobs with diff. Python impls? #echo '*/* PYTHON_TARGETS: python3_10 python3_11 python3_12' >> /etc/portage/package.use/python echo '*/* PYTHON_TARGETS: python3_12' >> /etc/portage/package.use/python cat <<-EOF >> /etc/portage/profile/use.mask -python_targets_python3_12 -python_single_target_python3_12 EOF cat <<-EOF >> /etc/portage/profile/use.stable.mask -python_targets_python3_12 -python_single_target_python3_12 EOF echo 'dev-lang/python ensurepip' >> /etc/portage/package.use/python # Silly mono circular dep #USE=minimal emerge --oneshot dev-lang/mono # If we don't want to do this, we could use the 'portage' container instead # so the stage3/repo match. emerge --update --deep --changed-use @world qlop -d 'yesterday' env-update && . /etc/profile rm /usr/lib/python/EXTERNALLY-MANAGED python3 -m ensurepip install_python_packages python3 -m pip install "${base_python_pkgs[@]}" echo "source /etc/profile" >> /ci/env_vars.sh # Cleanup to avoid including large contents in the docker image. # We don't need cache files that are side artifacts of installing packages. # We also don't need the gentoo tree -- the official docker image doesn't # either, and expects you to use emerge-webrsync once you need it. rm -rf /var/cache/binpkgs rm -rf /var/cache/distfiles rm -rf /var/db/repos/gentoo ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3177643 meson-1.9.1/ci/ciimage/opensuse/0000755000175000017500000000000015064306100017336 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/opensuse/image.json0000644000175000017500000000031615064306076021327 0ustar00eschwartzeschwartz{ "base_image": "opensuse/tumbleweed:latest", "env": { "CI": "1", "SKIP_STATIC_BOOST": "1", "SINGLE_DUB_COMPILER": "1", "MESON_CI_JOBNAME": "linux-opensuse-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/opensuse/install.sh0000755000175000017500000000535215064306076021364 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh pkgs=( python3-pip python3 python3-devel python3-setuptools ninja make git autoconf automake patch libjpeg-devel elfutils gcc gcc-c++ gcc-fortran gcc-objc gcc-obj-c++ vala rust bison flex curl lcov mono-core gtkmm3-devel gtest gmock protobuf-devel wxGTK3-3_2-devel gobject-introspection-devel itstool gtk3-devel java-17-openjdk-devel gtk-doc llvm-devel clang-devel sdl2-compat-devel graphviz-devel zlib-devel zlib-devel-static #hdf5-devel netcdf-devel libscalapack2-openmpi3-devel libscalapack2-gnu-openmpi3-hpc-devel openmpi3-devel doxygen vulkan-devel vulkan-validationlayers openssh mercurial libpcap-devel libgpgme-devel libqt5-qtbase-devel libqt5-qttools-devel libqt5-linguist libqt5-qtbase-private-headers-devel qt6-declarative-devel qt6-base-devel qt6-tools qt6-tools-linguist qt6-declarative-tools qt6-core-private-devel libwmf-devel valgrind cmake nasm gnustep-base-devel gettext-tools gettext-runtime gettext-csharp ncurses-devel libxml2-devel libxslt-devel libyaml-devel glib2-devel json-glib-devel boost-devel libboost_date_time-devel libboost_filesystem-devel libboost_locale-devel libboost_system-devel libboost_test-devel libboost_log-devel libboost_regex-devel libboost_python3-devel libboost_regex-devel # HACK: remove npm once we switch back to hotdoc sdist npm ) # Sys update zypper --non-interactive patch --with-update --with-optional zypper --non-interactive update # Install deps zypper install -y "${pkgs[@]}" # HACK: build hotdoc from git repo since current sdist is broken on modern compilers # change back to 'hotdoc' once it's fixed install_python_packages git+https://github.com/hotdoc/hotdoc # HACK: uninstall npm after building hotdoc, remove when we remove npm zypper remove -y -u npm echo 'export PKG_CONFIG_PATH="/usr/lib64/mpi/gcc/openmpi3/lib64/pkgconfig:$PKG_CONFIG_PATH"' >> /ci/env_vars.sh # dmd is very special on OpenSUSE (as in the packages do not work) # see https://bugzilla.opensuse.org/show_bug.cgi?id=1162408 curl -fsS https://dlang.org/install.sh | bash -s dmd | tee dmd_out.txt cat dmd_out.txt | grep source | sed 's/^[^`]*`//g' | sed 's/`.*//g' >> /ci/env_vars.sh chmod +x /ci/env_vars.sh # Lower ulimit before running dub, otherwise there's a very high chance it will OOM. # See: https://github.com/dlang/phobos/pull/9048 and https://github.com/dlang/phobos/pull/8990 echo 'ulimit -n -S 10000' >> /ci/env_vars.sh source /ci/env_vars.sh dub_fetch dubtestproject@1.2.0 dub build dubtestproject:test1 --compiler=dmd --arch=x86_64 dub build dubtestproject:test2 --compiler=dmd --arch=x86_64 dub build dubtestproject:test3 --compiler=dmd --arch=x86_64 dub_fetch urld@3.0.0 dub build urld --compiler=dmd --arch=x86_64 # Cleanup zypper --non-interactive clean --all ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1758563392.317992 meson-1.9.1/ci/ciimage/ubuntu-rolling/0000755000175000017500000000000015064306100020463 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/ubuntu-rolling/image.json0000644000175000017500000000021015064306076022445 0ustar00eschwartzeschwartz{ "base_image": "ubuntu:rolling", "env": { "CI": "1", "DC": "gdc", "MESON_CI_JOBNAME": "linux-ubuntu-rolling-gcc" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/ubuntu-rolling/install.sh0000755000175000017500000000561315064306076022511 0ustar00eschwartzeschwartz#!/bin/bash set -e source /ci/common.sh export DEBIAN_FRONTEND=noninteractive export LANG='C.UTF-8' export DC=gdc pkgs=( python3-pip libxml2-dev libxslt1-dev libyaml-dev libjson-glib-dev wget unzip qt5-qmake qtbase5-dev qtchooser qtbase5-dev-tools clang qmake6 qt6-base-dev qt6-base-private-dev qt6-declarative-dev qt6-declarative-dev-tools qt6-l10n-tools qt6-base-dev-tools libomp-dev llvm lcov dub ldc mingw-w64 mingw-w64-tools libz-mingw-w64-dev libclang-dev libgcrypt20-dev libgpgme-dev libhdf5-dev libboost-python-dev libboost-regex-dev libblocksruntime-dev libperl-dev liblapack-dev libscalapack-mpi-dev bindgen itstool openjdk-11-jre jq ) sed -i '/^Types: deb/s/deb/deb deb-src/' /etc/apt/sources.list.d/ubuntu.sources apt-get -y update apt-get -y upgrade apt-get -y install eatmydata # Base stuff eatmydata apt-get -y build-dep meson # packages eatmydata apt-get -y install "${pkgs[@]}" eatmydata apt-get -y install --no-install-recommends wine-stable # Wine is special install_python_packages hotdoc # Lower ulimit before running dub, otherwise there's a very high chance it will OOM. # See: https://github.com/dlang/phobos/pull/9048 and https://github.com/dlang/phobos/pull/8990 echo 'ulimit -n -S 10000' >> /ci/env_vars.sh ulimit -n -S 10000 # dub stuff dub_fetch dubtestproject@1.2.0 dub build dubtestproject:test1 --compiler=ldc2 --arch=x86_64 dub build dubtestproject:test2 --compiler=ldc2 --arch=x86_64 dub build dubtestproject:test3 --compiler=gdc --arch=x86_64 dub_fetch urld@3.0.0 dub build urld --compiler=gdc --arch=x86_64 # Remove debian version of Rust and install latest with rustup. # This is needed to get the cross toolchain as well. apt-get -y remove rustc || true wget -O - https://sh.rustup.rs | sh -s -- -y --profile minimal --component clippy source "$HOME/.cargo/env" rustup target add x86_64-pc-windows-gnu rustup target add arm-unknown-linux-gnueabihf # Zig # Use the GitHub API to get the latest release information LATEST_RELEASE=$(wget -qO- "https://api.github.com/repos/ziglang/zig/releases/latest") ZIGVER=$(echo "$LATEST_RELEASE" | jq -r '.tag_name') ZIG_BASE="zig-x86_64-linux-$ZIGVER" wget "https://ziglang.org/download/$ZIGVER/$ZIG_BASE.tar.xz" tar xf "$ZIG_BASE.tar.xz" rm -rf "$ZIG_BASE.tar.xz" cd "$ZIG_BASE" # As mentioned in the Zig readme, the binary and files under lib can be copied # https://github.com/ziglang/zig?tab=readme-ov-file#installation mv zig /usr/bin mv lib /usr/lib/zig # Copy the LICENSE mkdir -p /usr/share/doc/zig cp LICENSE /usr/share/doc/zig # Remove what's left of the directory cd .. rm -rf "$ZIG_BASE" # Hack for https://github.com/linux-test-project/lcov/issues/245 # https://github.com/linux-test-project/lcov/commit/bf135caf5f626e02191c42bd2773e08a0bb9b7e5 # XXX: Drop this once Ubuntu has lcov-2.1* git clone https://github.com/linux-test-project/lcov cd lcov make install # cleanup apt-get -y clean apt-get -y autoclean ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/ciimage/ubuntu-rolling/test.sh0000755000175000017500000000011015064306076022005 0ustar00eschwartzeschwartz#!/bin/bash set -e testFN() { set +e false } testFN false exit 0 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3182168 meson-1.9.1/ci/intel-scripts/0000755000175000017500000000000015064306100016677 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/intel-scripts/activate_windows.bat0000644000175000017500000000117415064306076022760 0ustar00eschwartzeschwartzREM SPDX-FileCopyrightText: 2020 Intel Corporation REM REM SPDX-License-Identifier: MIT set VS_VER=%1 @call "C:\Program Files (x86)\Intel\oneAPI\setvars-vcvarsall.bat" %VS_VER% for /f "tokens=* usebackq" %%f in (`dir /b "C:\Program Files (x86)\Intel\oneAPI\compiler\" ^| findstr /V latest ^| sort`) do @set "LATEST_VERSION=%%f" @call "C:\Program Files (x86)\Intel\oneAPI\compiler\%LATEST_VERSION%\env\vars.bat" echo "Visual Studio Version: %VS_VER%" echo "OneAPI version: %LATEST_VERSION%" echo "C:\Program Files (x86)\Intel\oneAPI\compiler\%LATEST_VERSION%\env\vars.bat" echo "OneAPI root directory: %ONEAPI_ROOT%" where ifort.exe ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/intel-scripts/cache_exclude_windows.sh0000755000175000017500000000142215064306076023577 0ustar00eschwartzeschwartz#!/bin/bash # SPDX-FileCopyrightText: 2020 Intel Corporation # # SPDX-License-Identifier: MIT #shellcheck disable=SC2010 LATEST_VERSION=$(ls -1 "C:\Program Files (x86)\Intel\oneAPI\compiler" | grep -v latest | sort | tail -1) rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\compiler\lib\ia32_win" rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\bin\intel64_ia32" rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\emu" rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\oclfpga" rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\ocloc" rm -rf "C:\Program Files (x86)\Intel\oneAPI\compiler\'$LATEST_VERSION'\windows\lib\x86" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/intel-scripts/install_windows.bat0000644000175000017500000000133415064306076022624 0ustar00eschwartzeschwartzREM SPDX-FileCopyrightText: 2022 Intel Corporation REM REM SPDX-License-Identifier: MIT set URL=%1 set COMPONENTS=%2 curl.exe --output %TEMP%\webimage.exe --url %URL% --retry 5 --retry-delay 5 start /b /wait %TEMP%\webimage.exe -s -x -f webimage_extracted --log extract.log del %TEMP%\webimage.exe if "%COMPONENTS%"=="" ( webimage_extracted\bootstrapper.exe -s --action install --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=. ) else ( webimage_extracted\bootstrapper.exe -s --action install --components=%COMPONENTS% --eula=accept -p=NEED_VS2017_INTEGRATION=0 -p=NEED_VS2019_INTEGRATION=0 -p=NEED_VS2022_INTEGRATION=0 --log-dir=. ) rd /s/q "webimage_extracted" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/ci/run.ps10000644000175000017500000000770315064306076015353 0ustar00eschwartzeschwartzpython ./skip_ci.py --base-branch-env=SYSTEM_PULLREQUEST_TARGETBRANCH --is-pull-env=SYSTEM_PULLREQUEST_PULLREQUESTID --base-branch-origin if ($LastExitCode -ne 0) { exit 0 } # remove Chocolatey, MinGW, Strawberry Perl from path, so we don't find gcc/gfortran and try to use it # remove PostgreSQL from path so we don't pickup a broken zlib from it $env:Path = ($env:Path.Split(';') | Where-Object { $_ -notmatch 'mingw|Strawberry|Chocolatey|PostgreSQL' }) -join ';' if ($env:arch -eq 'x64') { # Rust puts its shared stdlib in a secret place, but it is needed to run tests. $env:Path += ";$HOME/.rustup/toolchains/stable-x86_64-pc-windows-msvc/bin" } elseif ($env:arch -eq 'x86') { # Switch to the x86 Rust toolchain rustup default stable-i686-pc-windows-msvc # Also install clippy rustup component add clippy # Rust puts its shared stdlib in a secret place, but it is needed to run tests. $env:Path += ";$HOME/.rustup/toolchains/stable-i686-pc-windows-msvc/bin" # Need 32-bit Python for tests that need the Python dependency $env:Path = "C:\hostedtoolcache\windows\Python\3.7.9\x86;C:\hostedtoolcache\windows\Python\3.7.9\x86\Scripts;$env:Path" } # Set the CI env var for the meson test framework $env:CI = '1' # download and install prerequisites function DownloadFile([String] $Source, [String] $Destination) { $retries = 10 echo "Downloading $Source" for ($i = 1; $i -le $retries; $i++) { try { (New-Object net.webclient).DownloadFile($Source, $Destination) break # succeeded } catch [net.WebException] { if ($i -eq $retries) { throw # fail on last retry } $backoff = (10 * $i) # backoff 10s, 20s, 30s... echo ('{0}: {1}' -f $Source, $_.Exception.Message) echo ('Retrying in {0}s...' -f $backoff) Start-Sleep -m ($backoff * 1000) } } } if (($env:backend -eq 'ninja') -and ($env:arch -ne 'arm64')) { $dmd = $true } else { $dmd = $false } DownloadFile -Source https://github.com/mesonbuild/cidata/releases/download/ci5/ci_data.zip -Destination $env:AGENT_WORKFOLDER\ci_data.zip echo "Extracting ci_data.zip" Expand-Archive $env:AGENT_WORKFOLDER\ci_data.zip -DestinationPath $env:AGENT_WORKFOLDER\ci_data & "$env:AGENT_WORKFOLDER\ci_data\install.ps1" -Arch $env:arch -Compiler $env:compiler -Boost $true -DMD $dmd if ($env:arch -eq 'x64') { DownloadFile -Source https://downloads.python.org/pypy/pypy3.8-v7.3.9-win64.zip -Destination $env:AGENT_WORKFOLDER\pypy38.zip Expand-Archive $env:AGENT_WORKFOLDER\pypy38.zip -DestinationPath $env:AGENT_WORKFOLDER\pypy38 $ENV:Path = $ENV:Path + ";$ENV:AGENT_WORKFOLDER\pypy38\pypy3.8-v7.3.9-win64;$ENV:AGENT_WORKFOLDER\pypy38\pypy3.8-v7.3.9-win64\Scripts" pypy3 -m ensurepip DownloadFile -Source https://www.python.org/ftp/python/2.7.18/python-2.7.18.amd64.msi -Destination $env:AGENT_WORKFOLDER\python27.msi Start-Process msiexec.exe -Wait -ArgumentList "/I $env:AGENT_WORKFOLDER\python27.msi /quiet" } echo "=== PATH BEGIN ===" echo ($env:Path).Replace(';',"`n") echo "=== PATH END ===" echo "" $progs = @("python","ninja","pkg-config","cl","rc","link","pypy3","ifort") foreach ($prog in $progs) { echo "" echo "Locating ${prog}:" where.exe $prog } echo "" echo "Ninja / MSBuild version:" if ($env:backend -eq 'ninja') { ninja --version } else { MSBuild /version } echo "" echo "Python version:" python --version # Needed for running unit tests in parallel. echo "" python -m pip --disable-pip-version-check install --upgrade pefile pytest-xdist pytest-subtests fastjsonschema # Needed for running the Cython tests python -m pip --disable-pip-version-check install cython echo "" echo "=== Start running tests ===" # Starting from VS2019 Powershell(?) will fail the test run # if it prints anything to stderr. Python's test runner # does that by default so we need to forward it. cmd /c "python 2>&1 run_tests.py --backend $env:backend $env:extraargs" exit $LastExitCode ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/contributing.md0000644000175000017500000000050515064306076016551 0ustar00eschwartzeschwartz## Contributing to the Meson build system Thank you for your interest in participating to the development! A large fraction of Meson is contributed by people outside the core team and we are *excited* to see what you do. **Contribution instructions can be found on the website** @ https://mesonbuild.com/Contributing.html ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3202298 meson-1.9.1/cross/0000755000175000017500000000000015064306100014635 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/arm64cl.txt0000644000175000017500000000057215064306076016666 0ustar00eschwartzeschwartz[binaries] c = 'cl' cpp = 'cl' fc = 'false' ar = 'lib' windres = 'rc' [built-in options] c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP'] c_link_args = ['-APPCONTAINER', 'WindowsApp.lib'] cpp_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP'] cpp_link_args = ['-APPCONTAINER', 'WindowsApp.lib'] [host_machine] system = 'windows' cpu_family = 'aarch64' cpu = 'armv8' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/armcc.txt0000644000175000017500000000113215064306076016474 0ustar00eschwartzeschwartz# This file assumes that path to the arm compiler toolchain is added # to the environment(PATH) variable, so that Meson can find # the armcc, armlink and armar while building. [binaries] c = 'armcc' cpp = 'armcc' ar = 'armar' strip = 'armar' [built-in options] # The '--cpu' option with the appropriate target type should be mentioned # to cross compile c/c++ code with armcc,. c_args = ['--cpu=Cortex-M0plus'] cpp_args = ['--cpu=Cortex-M0plus'] [host_machine] system = 'bare metal' # Update with your system name - bare metal/OS. cpu_family = 'arm' cpu = 'Cortex-M0+' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/armclang-linux.txt0000644000175000017500000000235215064306076020335 0ustar00eschwartzeschwartz# Using ARM compilers from Linux command line is tricky and # not really well documented because they want you to use # their IDE instead. # # First you need to do the full install with the IDE and set # up license files et al. This may be possible from the command # line. # # Then you need to do the following: # # Select toolchain by running /opt/arm/developmentstudio-2019.0/bin/select_default_toolchain # Armcc is only available in toolchain version 5. # Armclang is only available in toolchain version 6. # Start shell with /opt/arm/developmentstudio-2019.0/bin/suite_exec zsh # Now the compilers will work. [binaries] # we could set exe_wrapper = qemu-arm-static but to test the case # when cross compiled binaries can't be run we don't do that c = ['/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armclang', '--target=aarch64-arm-none-eabi'] #c = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler5.06u6/bin/armcc' #cpp = '/usr/bin/arm-linux-gnueabihf-g++' ar = '/opt/arm/developmentstudio-2019.0/sw/ARMCompiler6.12/bin/armar' #strip = '/usr/arm-linux-gnueabihf/bin/strip' #pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config' [host_machine] system = 'baremetal' cpu_family = 'arm' cpu = 'armv7' # Not sure if correct. endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/armclang.txt0000644000175000017500000000125515064306076017201 0ustar00eschwartzeschwartz# This file assumes that path to the arm compiler toolchain is added # to the environment(PATH) variable, so that Meson can find # the armclang, armlink and armar while building. [binaries] c = ['armclang', '--target=arm-arm-none-eabi'] cpp = ['armclang', '--target=arm-arm-none-eabi'] ar = 'armar' strip = 'armar' [built-in options] # The '--target', '-mcpu' options with the appropriate values should be mentioned # to cross compile c/c++ code with armclang. c_args = ['-mcpu=cortex-m0plus'] cpp_args = ['-mcpu=cortex-m0plus'] [host_machine] system = 'bare metal' # Update with your system name - bare metal/OS. cpu_family = 'arm' cpu = 'Cortex-M0+' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/c2000.txt0000644000175000017500000000102215064306076016131 0ustar00eschwartzeschwartz# This file assumes that path to the Texas Instruments C20000 toolchain is added # to the environment(PATH) variable, so that Meson can find # cl2000 and ar2000 while building. [binaries] c = 'cl2000' ar = 'ar2000' strip = 'cl2000' [host_machine] system = 'bare metal' cpu_family = 'c2000' cpu = 'c28x' endian = 'little' [built-in options] c_args = [ '-v28', '-ml', '-mt'] c_link_args = [ '-z', '--rom_model', '\f28004x_flash.cmd'] cpp_args = [] cpp_link_args = [] [properties] needs_exe_wrapper = true ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ccomp-armv7a.txt0000644000175000017500000000041615064306076017707 0ustar00eschwartzeschwartz[binaries] c = ['ccomp', '-target', 'armv7a-eabi'] ar = 'ccomp' strip = 'strip' [built-in options] c_args = ['-fall'] [host_machine] system = 'bare metal' # Update with your system name - bare metal/OS. cpu_family = 'arm' cpu = 'Cortex-A9' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ccrx.txt0000644000175000017500000000104115064306076016345 0ustar00eschwartzeschwartz# This file assumes that path to the Renesas CC-RX toolchain is added # to the environment(PATH) variable, so that Meson can find # ccrx and rlink while building. [binaries] c = 'ccrx' cpp = 'ccrx' ar = 'rlink' strip = 'rlink' [built-in options] # The '--cpu' option with the appropriate target type should be mentioned # to cross compile c/c++ code with ccrx,. c_args = ['-cpu=rx600'] cpp_args = ['-cpu=rx600'] c_link_args = [] cpp_link_args = [] [host_machine] system = 'bare metal' cpu_family = 'rx' cpu = 'rx600' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/cuda-cross.json0000644000175000017500000000010115064306076017577 0ustar00eschwartzeschwartz{ "file": "cuda-cross.txt", "tests": ["cuda"], "env": {} } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/cuda-cross.txt0000644000175000017500000000066115064306076017460 0ustar00eschwartzeschwartz[binaries] c = ['/usr/bin/aarch64-linux-gnu-gcc'] cpp = ['/usr/bin/aarch64-linux-gnu-g++'] cuda = ['/usr/local/cuda/bin/nvcc'] ar = '/usr/bin/aarch64-linux-gnu-ar' strip = '/usr/bin/aarch64-linux-gnu-strip' ld = '/usr/bin/aarch64-linux-gnu-ld' [host_machine] system = 'linux' cpu_family = 'aarch64' cpu = 'aarch64' endian = 'little' [built-in options] cuda_link_args = ['-lstdc++'] cuda_ccbindir = '/usr/bin/aarch64-linux-gnu-gcc' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/iphone.txt0000644000175000017500000000256415064306076016703 0ustar00eschwartzeschwartz# This is a cross compilation file from OSX Yosemite to iPhone # Apple keeps changing the location and names of files so # these might not work for you. Use the googles and xcrun. [binaries] c = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'] cpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'] objc = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'] objcpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk'] ar = 'ar' strip = 'strip' [built-in options] c_args = ['-miphoneos-version-min=11.0'] cpp_args = ['-miphoneos-version-min=11.0'] c_link_args = ['-miphoneos-version-min=11.0'] cpp_link_args = ['-miphoneos-version-min=11.0'] objc_args = ['-miphoneos-version-min=11.0'] objcpp_args = ['-miphoneos-version-min=11.0'] [properties] root = '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer' has_function_printf = true has_function_hfkerhisadf = false [host_machine] system = 'darwin' subsystem = 'ios' kernel = 'xnu' cpu_family = 'aarch64' cpu = 'aarch64' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/linux-mingw-w64-32bit.json0000644000175000017500000000031015064306076021353 0ustar00eschwartzeschwartz{ "file": "linux-mingw-w64-32bit.txt", "tests": ["common", "cmake"], "env": { "WINEPATH": "/usr/lib/gcc/i686-w64-mingw32/9.2-posix;/usr/i686-w64-mingw32/bin;/usr/i686-w64-mingw32/lib" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/linux-mingw-w64-32bit.txt0000644000175000017500000000162615064306076021234 0ustar00eschwartzeschwartz[binaries] c = '/usr/bin/i686-w64-mingw32-gcc' cpp = '/usr/bin/i686-w64-mingw32-g++' objc = '/usr/bin/i686-w64-mingw32-gcc' ar = '/usr/bin/i686-w64-mingw32-ar' strip = '/usr/bin/i686-w64-mingw32-strip' pkg-config = '/usr/bin/i686-w64-mingw32-pkg-config' windres = '/usr/bin/i686-w64-mingw32-windres' exe_wrapper = 'wine' ld = '/usr/bin/i686-w64-mingw32-ld' cmake = '/usr/bin/cmake' [properties] # Directory that contains 'bin', 'lib', etc root = '/usr/i686-w64-mingw32' # Directory that contains 'bin', 'lib', etc for the toolchain and system libraries sys_root = '/usr/i686-w64-mingw32/sys-root/mingw' [host_machine] system = 'windows' cpu_family = 'x86' cpu = 'i686' endian = 'little' [cmake] CMAKE_BUILD_WITH_INSTALL_RPATH = 'ON' CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = 'NEVER' CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = 'ONLY' CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = 'ONLY' CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = 'ONLY' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/linux-mingw-w64-64bit.json0000644000175000017500000000031615064306076021366 0ustar00eschwartzeschwartz{ "file": "linux-mingw-w64-64bit.txt", "tests": ["common", "cmake"], "env": { "WINEPATH": "/usr/lib/gcc/x86_64-w64-mingw32/9.2-posix;/usr/x86_64-w64-mingw32/bin;/usr/x86_64-w64-mingw32/lib" } } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/linux-mingw-w64-64bit.txt0000644000175000017500000000161115064306076021233 0ustar00eschwartzeschwartz[binaries] c = '/usr/bin/x86_64-w64-mingw32-gcc' cpp = '/usr/bin/x86_64-w64-mingw32-g++' objc = '/usr/bin/x86_64-w64-mingw32-gcc' ar = '/usr/bin/x86_64-w64-mingw32-ar' strip = '/usr/bin/x86_64-w64-mingw32-strip' pkg-config = '/usr/bin/x86_64-w64-mingw32-pkg-config' windres = '/usr/bin/x86_64-w64-mingw32-windres' exe_wrapper = 'wine' cmake = '/usr/bin/cmake' [properties] # Directory that contains 'bin', 'lib', etc root = '/usr/x86_64-w64-mingw32' # Directory that contains 'bin', 'lib', etc for the toolchain and system libraries sys_root = '/usr/x86_64-w64-mingw32/sys-root/mingw' [host_machine] system = 'windows' cpu_family = 'x86_64' cpu = 'x86_64' endian = 'little' [cmake] CMAKE_BUILD_WITH_INSTALL_RPATH = 'ON' CMAKE_FIND_ROOT_PATH_MODE_PROGRAM = 'NEVER' CMAKE_FIND_ROOT_PATH_MODE_LIBRARY = 'ONLY' CMAKE_FIND_ROOT_PATH_MODE_INCLUDE = 'ONLY' CMAKE_FIND_ROOT_PATH_MODE_PACKAGE = 'ONLY' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/metrowerks-arm.txt0000644000175000017500000000111615064306076020370 0ustar00eschwartzeschwartz# This file assumes that the path to your Metrowerks Embedded ARM # toolchain is added to the environment(PATH) variable, so that # Meson can find the binaries while building. [binaries] c = 'mwccarm' c_ld = 'mwldarm' cpp = 'mwccarm' cpp_ld = 'mwldarm' ar = 'mwldarm' as = 'mwasmarm' [built-in options] c_args = ['-lang', 'c99', '-D_NITRO', '-nosyspath'] c_link_args = '@DIRNAME@' / 'metrowerks.lcf' cpp_args = ['-lang', 'c++', '-D_NITRO', '-nosyspath'] cpp_link_args = '@DIRNAME@' / 'metrowerks.lcf' [host_machine] system = 'bare metal' cpu = 'arm' cpu_family = 'arm' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/metrowerks-eppc.txt0000644000175000017500000000107115064306076020540 0ustar00eschwartzeschwartz# This file assumes that the path to your Metrowerks toolchain # of choice is added to the environment(PATH) variable, so that # Meson can find the binaries while building. [binaries] c = 'mwcceppc' c_ld = 'mwldeppc' cpp = 'mwcceppc' cpp_ld = 'mwldeppc' ar = 'mwldeppc' as = 'mwasmeppc' [built-in options] c_args = ['-lang', 'c99', '-nosyspath'] c_link_args = '@DIRNAME@' / 'metrowerks.lcf' cpp_args = ['-lang', 'c++', '-nosyspath'] cpp_link_args = '@DIRNAME@' / 'metrowerks.lcf' [host_machine] system = 'bare metal' cpu = 'ppc' cpu_family = 'ppc' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/metrowerks.lcf0000644000175000017500000000063315064306076017543 0ustar00eschwartzeschwartz# General-purpose linker script for Metrowerks toolchains. # This script will link a blank application. Its only purpose # is to allow the toolchains to run Meson tests. To link an # actual application, you need to write your own fine-tuned lcf. MEMORY { TEST (RWX) : ORIGIN=0, LENGTH=0 } SECTIONS { .TEST:{ * (.text) * (.data) * (.rodata) * (.bss) __startup=.; } > TEST }././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/msp430.txt0000644000175000017500000000077715064306076016453 0ustar00eschwartzeschwartz# This file assumes that path to the Texas Instruments MSP430 toolchain is added # to the environment(PATH) variable, so that Meson can find # cl430 and ar430 while building. [binaries] c = cl430 ar = ar430 strip = strip430 [host_machine] system = 'baremetal' cpu_family = 'msp430' endian = 'little' [built-in options] c_args = [ '-vmsp', '--printf_support=minimal'] c_link_args = [ '--rom_model', '-llibc.a',] cpp_args = [] cpp_link_args = [] [properties] needs_exe_wrapper = true ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/none.txt0000644000175000017500000000046515064306076016356 0ustar00eschwartzeschwartz# native file used to make the build machine compiler unusable [host_machine] system = 'none' cpu_family = 'none' cpu = 'none' endian = 'little' [properties] [binaries] c = ['false'] cpp = ['false'] fc = ['false'] objc = ['false'] objcpp = ['false'] ar = ['false'] pkg-config = ['false'] cmake = ['false'] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ownstdlib.txt0000644000175000017500000000041715064306076017421 0ustar00eschwartzeschwartz# This is a setup for compiling a program that runs natively # but uses a custom std lib. This test will only work on # x86_64. [target_machine] system = 'linux' cpu_family = 'x86_64' cpu = 'x86_64' endian = 'little' [properties] c_stdlib = 'mylibc' # Subproject name ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ti-c6000.txt0000644000175000017500000000070215064306076016553 0ustar00eschwartzeschwartz# Cross file tested on Texas Instruments C6000 compiler (bare metal DSP devices) # This file assumes that path to the Texas Instruments C6000 toolchain is added # to the environment(PATH) variable. [host_machine] system = 'c6000' cpu_family = 'c6000' cpu = 'c64x' endian = 'little' [binaries] c = 'cl6x' cpp = 'cl6x' ar = 'ar6x' strip = 'strip6x' nm = 'nm6x' as = 'asm6x' [properties] needs_exe_wrapper = true has_function_printf = true bits = 32 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/tvos.txt0000644000175000017500000000173715064306076016415 0ustar00eschwartzeschwartz# This is a cross compilation file from OSX Yosemite to Apple tvOS # Apple keeps changing the location and names of files so # these might not work for you. Use the googles and xcrun. [binaries] c = ['clang', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] cpp = ['clang++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS.sdk'] ar = 'ar' strip = 'strip' [built-in options] c_args = ['-mtvos-version-min=12.0'] cpp_args = ['-mtvos-version-min=12.0'] c_link_args = ['-mtvos-version-min=12.0'] cpp_link_args = ['-mtvos-version-min=12.0'] [properties] root = '/Applications/Xcode.app/Contents/Developer/Platforms/AppleTVOS.platform/Developer' has_function_printf = true has_function_hfkerhisadf = false [host_machine] system = 'darwin' subsystem = 'tvos' kernel = 'xnu' cpu_family = 'arm' cpu = 'arm64' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ubuntu-armhf.json0000644000175000017500000000010515064306076020155 0ustar00eschwartzeschwartz{ "file": "ubuntu-armhf.txt", "tests": ["common"], "env": {} } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ubuntu-armhf.txt0000644000175000017500000000175415064306076020036 0ustar00eschwartzeschwartz[binaries] # we could set exe_wrapper = qemu-arm-static but to test the case # when cross compiled binaries can't be run we don't do that c = ['/usr/bin/arm-linux-gnueabihf-gcc'] cpp = ['/usr/bin/arm-linux-gnueabihf-g++'] rust = ['rustc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7'] rustdoc = ['rustdoc', '--target', 'arm-unknown-linux-gnueabihf', '-C', 'linker=/usr/bin/arm-linux-gnueabihf-gcc-7'] ar = '/usr/arm-linux-gnueabihf/bin/ar' strip = '/usr/arm-linux-gnueabihf/bin/strip' pkg-config = '/usr/bin/arm-linux-gnueabihf-pkg-config' ld = '/usr/bin/arm-linux/gnueabihf-ld' [built-in options] # Used in unit test '140 get define' c_args = ['-DMESON_TEST_ISSUE_1665=1'] cpp_args = '-DMESON_TEST_ISSUE_1665=1' [properties] root = '/usr/arm-linux-gnueabihf' has_function_printf = true has_function_hfkerhisadf = false skip_sanity_check = true [host_machine] system = 'linux' cpu_family = 'arm' cpu = 'armv7' # Not sure if correct. endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/ubuntu-faketarget.txt0000644000175000017500000000061715064306076021053 0ustar00eschwartzeschwartz# This is a setup for compiling a program that runs natively # but produces output that runs on a different platform. # That is either a cross compiler or something like binutils. # We don't need to specify any properties or compilers, # for we use the native ones and can run the resulting # binaries directly. [target_machine] system = 'linux' cpu_family = 'mips' cpu = 'mips' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/wasm.txt0000644000175000017500000000042415064306076016361 0ustar00eschwartzeschwartz[binaries] c = 'emcc' cpp = 'em++' ar = 'emar' exe_wrapper = 'node' [built-in options] c_args = [] c_link_args = ['-sEXPORT_ALL=1'] cpp_args = [] cpp_link_args = ['-sEXPORT_ALL=1'] [host_machine] system = 'emscripten' cpu_family = 'wasm32' cpu = 'wasm32' endian = 'little' ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/cross/xc16.txt0000644000175000017500000000103715064306076016174 0ustar00eschwartzeschwartz# This file assumes that path to the Microchip xc16 toolchain is added # to the environment(PATH) variable, so that Meson can find # xc16-gcc and xc16-ar while building. [binaries] c = 'xc16-gcc' ar = 'xc16-ar' strip = 'xc16-gcc' [host_machine] system = 'bare metal' cpu_family = 'dspic' cpu = '33ep64mc203' endian = 'little' [properties] needs_exe_wrapper = true [built-in options] c_args = [ '-c', '-mcpu=33EP64MC203', '-omf=elf'] c_link_args = [ '-mcpu=33EP64MC203', '-omf=elf', '-Wl,--script=p33EP64MC203.gld,'] ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3205986 meson-1.9.1/data/0000755000175000017500000000000015064306100014415 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/.coveragerc.in0000644000175000017500000000065615064306076017166 0ustar00eschwartzeschwartz[run] branch = True parallel = True concurrency = multiprocessing data_file = @ROOT@/.coverage/coverage source = @ROOT@/mesonbuild/ [report] exclude_lines = if T.TYPE_CHECKING: [paths] mesonbuild = mesonbuild/ __w/meson/meson/mesonbuild/ @ROOT@/mesonbuild/ [html] directory = @ROOT@/.coverage/html [xml] output = @ROOT@/.coverage/coverage.xml [json] output = @ROOT@/.coverage/coverage.json ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/com.mesonbuild.install.policy0000644000175000017500000000160015064306076022232 0ustar00eschwartzeschwartz The Meson Build System https://github.com/mesonbuild/meson Install the given project via Meson Authentication is required to install this project preferences-system no no auth_admin_keep /usr/bin/python3 /usr/bin/meson ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/macros.meson0000644000175000017500000000322415064306076016761 0ustar00eschwartzeschwartz%__meson %{_bindir}/meson %__meson_wrap_mode nodownload %__meson_auto_features enabled %__meson_verbose 1 %meson \ %set_build_flags \ %{shrink:%{__meson} setup \ --buildtype=plain \ --prefix=%{_prefix} \ --libdir=%{_libdir} \ --libexecdir=%{_libexecdir} \ --bindir=%{_bindir} \ --sbindir=%{_sbindir} \ --includedir=%{_includedir} \ --datadir=%{_datadir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ --localedir=%{_datadir}/locale \ --sysconfdir=%{_sysconfdir} \ --localstatedir=%{_localstatedir} \ --sharedstatedir=%{_sharedstatedir} \ --wrap-mode=%{__meson_wrap_mode} \ --auto-features=%{__meson_auto_features} \ %{_vpath_srcdir} %{_vpath_builddir} \ %{nil}} %meson_build \ %{shrink:%{__meson} compile \ -C %{_vpath_builddir} \ -j %{_smp_build_ncpus} \ %{?__meson_verbose:--verbose} \ %{nil}} %meson_install \ %{shrink:DESTDIR=%{buildroot} %{__meson} install \ -C %{_vpath_builddir} \ --no-rebuild \ %{!?__meson_verbose:--quiet} \ %{nil}} %meson_test \ %{shrink:%{__meson} test \ -C %{_vpath_builddir} \ --num-processes %{_smp_build_ncpus} \ --print-errorlogs \ %{nil}} # Declarative buildsystem, requires RPM 4.20+ to work # https://rpm-software-management.github.io/rpm/manual/buildsystem.html %buildsystem_meson_conf() %meson %* %buildsystem_meson_generate_buildrequires() %{nil} %buildsystem_meson_build() %meson_build %* %buildsystem_meson_install() %meson_install %* %buildsystem_meson_check() %meson_test %* ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/schema.xsd0000644000175000017500000001054115064306076016412 0ustar00eschwartzeschwartz ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.1974998 meson-1.9.1/data/shell-completions/0000755000175000017500000000000015064306100020056 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3206775 meson-1.9.1/data/shell-completions/bash/0000755000175000017500000000000015064306100020773 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/shell-completions/bash/meson0000644000175000017500000006470415064306076022066 0ustar00eschwartzeschwartz# shellcheck shell=bash _get_subprojects_dir() { # TODO: meson-info/intro-projectinfo.json has the info for the subproject # directory, but we can't know what the build directory is in these contexts. # Let's default to subprojects. # Get subprojects directory. All subprojects subcommands support --sourcedir, # so if that argument was passed, use it to find subprojects. subprojects_dir="subprojects" for (( i=${#COMP_WORDS[@]} - 1; i >= 0; i-- )); do # Exit early if we have made our way back to the command if [[ "${COMP_WORDS[$i]}" = "subprojects" ]]; then break fi prev=$((i - 1)) if [[ $prev -gt 0 ]] && [[ "${COMP_WORDS[$prev]}" = "--sourcedir" ]]; then subprojects_dir="${COMP_WORDS[$i]}" break fi done echo "$subprojects_dir" } _subprojects() { subprojects_dir=$(_get_subprojects_dir) pushd "$subprojects_dir" &>/dev/null || return local COMPREPLY=() _filedir # _filedir for whatever reason can't reason about symlinks, so -d will them. # Filter out wrap files with this expression. IFS=$'\n' echo "${COMPREPLY[*]}" | grep -vE '\.wrap$' | xargs popd &>/dev/null } _wraps() { subprojects_dir=$(_get_subprojects_dir) db="$subprojects_dir/wrapdb.json" if [[ ! -f "$db" ]]; then return fi document=$(cat "$db") wraps=($(python3 -c 'import sys, json for wrap in json.load(sys.stdin).keys(): print(wrap) ' <<< "$document")) echo "${wraps[@]}" } _meson() { command="${COMP_WORDS[1]}" subcommands=( setup configure dist install introspect init test wrap subprojects help rewrite compile devenv env2mfile ) if [[ " ${subcommands[*]} " =~ " ${command} " ]]; then "_meson-$command" "${COMP_WORDS[@]:1}" else _meson-setup "${COMP_WORDS[@]}" fi } && complete -F _meson meson _meson_complete_option() { option_string=$1 if [[ $# -eq 2 ]] && ! [[ "$option_string" == *=* ]]; then option_string="$option_string=$2" fi if [[ "$option_string" == *=* ]]; then _meson_complete_option_value "$option_string" else _meson_complete_option_name "$option_string" fi } _meson_complete_option_name() { option=$1 options=($(python3 -c 'import sys, json for option in json.load(sys.stdin): print(option["name"]) ' <<< "$(_meson_get_options)")) compopt -o nospace COMPREPLY=($(compgen -W '${options[@]}' -S= -- "$option")) } _meson_complete_option_value() { cur=$1 option_name=${cur%%=*} option_value=${cur#*=} if _meson_complete_filedir "$option_name" "$option_value"; then return fi options=($(python3 -c 'import sys, json for option in json.load(sys.stdin): if option["name"] != "'$option_name'": continue choices = [] if option["type"] == "boolean": choices.append("true") choices.append("false") elif option["type"] == "combo": for choice in option["choices"]: choices.append(choice) elif option["type"] == "feature": choices.append("auto") choices.append("enabled") choices.append("disabled") for choice in choices: if choice.startswith("'$cur'"): print(choice) ' <<< "$(_meson_get_options)")) COMPREPLY=("${options[@]}") } _meson_get_options() { local options for builddir in "${COMP_WORDS[@]}"; do if [[ -d "$builddir" ]]; then break fi builddir=. done options=$(meson introspect "$builddir" --buildoptions 2>/dev/null) && echo "$options" || echo '[]' } _meson_complete_filedir() { _filedir_in() { pushd "$1" &>/dev/null local COMPREPLY=() _filedir echo "${COMPREPLY[@]}" popd &>/dev/null } option=$1 cur=$2 case $option in prefix |\ bindir |\ datadir |\ includedir |\ infodir |\ libdir |\ licensedir |\ libexecdir |\ localedir |\ localstatedir |\ mandir |\ sbindir |\ sharedstatedir |\ sysconfdir |\ python.platlibdir |\ python.purelibdir |\ pkg-config-path |\ build.pkg-config-path |\ cmake-prefix-path |\ build.cmake-prefix-path) _filedir -d ;; cross-file) _filedir COMPREPLY+=($(_filedir_in "$XDG_DATA_DIRS"/meson/cross)) COMPREPLY+=($(_filedir_in /usr/local/share/meson/cross)) COMPREPLY+=($(_filedir_in /usr/share/meson/cross)) COMPREPLY+=($(_filedir_in "$XDG_DATA_HOME"/meson/cross)) COMPREPLY+=($(_filedir_in ~/.local/share/meson/cross)) ;; native-file) _filedir COMPREPLY+=($(_filedir_in "$XDG_DATA_DIRS"/meson/native)) COMPREPLY+=($(_filedir_in /usr/local/share/meson/native)) COMPREPLY+=($(_filedir_in /usr/share/meson/native)) COMPREPLY+=($(_filedir_in "$XDG_DATA_HOME"/meson/native)) COMPREPLY+=($(_filedir_in ~/.local/share/meson/native)) ;; *) return 1;; esac return 0 } _meson_compgen_options() { local -r cur=$1 if [[ ${cur:0:2} == -- ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) elif [[ ${cur:0:1} == - ]]; then if [[ ${#cur} == 1 ]]; then # Only add longopts if cur not "-something" COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "")) fi COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) else return 1 fi return 0 } _meson_common_setup_configure_longopts=( help prefix bindir datadir includedir infodir libdir licensedir libexecdir localedir localstatedir mandir sbindir sharedstatedir sysconfdir auto-features backend genvslite buildtype debug default-library errorlogs install-umask layout optimization prefer-static stdsplit strip unity unity-size warnlevel werror wrap-mode force-fallback-for vsenv pkgconfig.relocatable python.bytecompile python.install-env python.platlibdir python.purelibdir python.allow-limited-api pkg-config-path build.pkg-config-path cmake-prefix-path build.cmake-prefix-path clearcache ) _meson-setup() { shortopts=( h D v ) longopts=( ${_meson_common_setup_configure_longopts[@]} native-file cross-file version fatal-meson-warnings reconfigure wipe ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then if [[ ${prev:0:2} == -- ]] && _meson_complete_option "${prev:2}" "$cur"; then return elif [[ ${prev:0:1} == - ]] && [[ ${prev:1:2} != - ]] && _meson_complete_option "${prev:1}"; then return fi fi if _get_comp_words_by_ref -n '=' cur prev &>/dev/null; then if [[ $prev == -D ]]; then _meson_complete_option "$cur" return fi else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then _filedir -d if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi if [[ $COMP_CWORD == 1 ]]; then COMPREPLY+=($(compgen -W '${subcommands[*]}' -- "$cur")) fi fi } _meson-configure() { shortopts=( h D ) longopts=( ${_meson_common_setup_configure_longopts[@]} no-pager ) local cur prev if _get_comp_words_by_ref -n '=' cur prev &>/dev/null; then if [[ $prev == -D ]]; then _meson_complete_option "$cur" return fi else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then for dir in "${COMP_WORDS[@]}"; do if [[ -d "$dir" ]]; then break fi dir=. done if [[ ! -d "$dir/meson-private" ]]; then _filedir -d fi if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-dist() { shortopts=( h C ) longopts=( allow-dirty help formats include-subprojects no-tests ) local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then case $prev in -C) _filedir -d return ;; --formats) formats=( xztar gztar zip ) COMPREPLY+=($(compgen -W '${formats[*]}' -- "$cur")) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-install() { shortopts=( h n q C ) longopts=( help no-rebuild only-changed quiet destdir dry-run skip-subprojects tags strip ) local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then for i in "${!COMP_WORDS[@]}"; do opt="${COMP_WORDS[i]}" dir="${COMP_WORDS[i+1]}" case "$opt" in -C) break ;; esac dir=. done case $prev in -C | --destdir) _filedir -d return ;; --tags) tags=$(meson introspect "$dir" --install-plan | python3 -c 'import sys, json targets = json.load(sys.stdin)["targets"] for target, attributes in targets.items(): print(attributes["tag"]) ' 2> /dev/null) if [[ $? == 0 ]]; then COMPREPLY+=($(compgen -W '${tags[*]}' -- "$cur")) fi return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-introspect() { shortopts=( h a i f ) longopts=( ast benchmarks buildoptions buildsystem-files dependencies scan-dependencies installed install-plan projectinfo targets tests backend all indent force-object-output ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then for dir in "${COMP_WORDS[@]}"; do if [[ -d "$dir" ]]; then break fi dir=. done if [[ ! -d "$dir/meson-private" ]]; then _filedir -d fi if [ -z "$cur" ]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-init() { shortopts=( h C n e d l b f ) longopts=( help name executable deps language build builddir force type version ) if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-test() { shortopts=( h j q v t C ) longopts=( help maxfail repeat no-rebuild gdb gdb-path interactive list wrapper suite no-suite no-stdsplit print-errorlogs benchmark logbase num-processes verbose quiet timeout-multiplier setup max-lines test-args ) local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then case $prev in --maxfail | --repeat) # number, can't be completed return ;; --wrapper) _command_offset "$COMP_CWORD" return ;; --gdb-path) _filedir return ;; -C) _filedir -d return ;; --suite | --no-suite) for i in "${!COMP_WORDS[@]}"; do opt="${COMP_WORDS[i]}" dir="${COMP_WORDS[i+1]}" case "$opt" in -C) break ;; esac dir=. done suites=$(meson introspect "$dir" --tests | python3 -c 'import sys, json; for test in json.load(sys.stdin): for suite in test["suite"]: print(suite) ' 2> /dev/null) if [[ $? == 0 ]]; then COMPREPLY+=($(compgen -W '${suites[*]}' -- "$cur")) __ltrim_colon_completions "$cur" fi return ;; --logbase) # free string, can't be completed return ;; -j | --num-processes) # number, can't be completed return ;; -t | --timeout-multiplier) # number, can't be completed return ;; --setup) # TODO return ;; --test-args) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then for dir in "${COMP_WORDS[@]}"; do if [[ -d "$dir" ]]; then break fi dir=. done if [[ ! -d "$dir/meson-private" ]]; then _filedir -d fi for i in "${!COMP_WORDS[@]}"; do opt="${COMP_WORDS[i]}" dir="${COMP_WORDS[i+1]}" case "$opt" in -C) break ;; esac dir=. done tests=$(meson introspect "$dir" --tests | python3 -c 'import sys, json; for test in json.load(sys.stdin): print(test["name"]) ' 2> /dev/null) if [[ $? == 0 ]]; then COMPREPLY+=($(compgen -W '${tests[*]}' -- "$cur")) fi if [ -z "$cur" ]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}' -- "${cur:2}")) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}' -- "${cur:1}")) fi fi } _meson-wrap() { shortopts=( h ) longopts=( help ) subcommands=( info install list promote search status update update-db ) for i in "$@"; do if [[ " ${subcommands[*]} " =~ " $i " ]]; then "_meson-wrap-$i" "${COMP_WORDS[i]:1}" return fi done local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then COMPREPLY+=($(compgen -W '${subcommands[*]}' -- "$cur")) if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-wrap-info() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi read -ra wraps < <(_wraps) COMPREPLY+=($(compgen -W '${wraps[*]}' -- "$cur")) } _meson-wrap-install() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi read -ra wraps < <(_wraps) COMPREPLY+=($(compgen -W '${wraps[*]}' -- "$cur")) } _meson-wrap-list() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-wrap-promote() { shortopts=( h ) longopts=( help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then _filedir COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-wrap-search() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi read -ra wraps < <(_wraps) COMPREPLY+=($(compgen -W '${wraps[*]}' -- "$cur")) } _meson-wrap-status() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-wrap-update() { shortopts=( h ) longopts=( allow-insecure force help sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-wrap-update-db() { shortopts=( h ) longopts=( allow-insecure help ) local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-subprojects() { shortopts=( h ) longopts=( help ) subcommands=( checkout download foreach packagefiles purge update ) for i in "$@"; do if [[ " ${subcommands[*]} " =~ " $i " ]]; then "_meson-subprojects-$i" "${COMP_WORDS[i]:1}" return fi done local cur prev if ! _get_comp_words_by_ref cur prev &>/dev/null; then cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then COMPREPLY+=($(compgen -W '${subcommands[*]}' -- "$cur")) if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-subprojects-checkout() { shortopts=( b h j ) longopts=( allow-insecure help num-processes sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-subprojects-download() { shortopts=( h j ) longopts=( allow-insecure help num-processes sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-subprojects-foreach() { shortopts=( h j ) longopts=( allow-insecure help num-processes sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-subprojects-packagefiles() { shortopts=( h j ) longopts=( allow-insecure apply help num-processes save sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; --apply | --save) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-subprojects-purge() { shortopts=( h j ) longopts=( allow-insecure confirm help include-cache num-processes sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; --apply | --save) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-subprojects-update() { shortopts=( h j ) longopts=( allow-insecure help num-processes rebase reset sourcedir types ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then case $prev in --sourcedir) _filedir -d return ;; --types) types=( file git hg svn ) COMPREPLY+=($(compgen -W '${types[*]}' -- "$cur")) return ;; -j | --num-processes) # number, can't be completed return ;; --rebase | --reset) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi COMPREPLY+=($(_subprojects)) } _meson-help() { longopts=( setup configure dist install introspect init test wrap subprojects rewrite compile devenv env2mfile ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then COMPREPLY+=($(compgen -W '${longopts[*]}' -- "$cur")) fi } _meson-rewrite() { : TODO } _meson-compile() { shortopts=( h C j l v ) longopts=( help clean jobs load-average verbose ninja-args vs-args xcode-args ) local cur prev if _get_comp_words_by_ref cur prev &>/dev/null; then if [[ ${prev:0:2} == -- ]] && _meson_complete_option "${prev:2}" "$cur"; then return elif [[ ${prev:0:1} == - ]] && [[ ${prev:1:2} != - ]] && _meson_complete_option "${prev:1}"; then return fi else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then _filedir -d if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-devenv() { shortopts=( h w ) longopts=( dump dump-format help workdir ) local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then case $prev in -C | -w | --workdir) _filedir -d return ;; --dump) _filedir return ;; --dump-format) dump_formats=( sh export vscode ) COMPREPLY+=($(compgen -W '${dump_formats[*]}' -- "$cur")) return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } _meson-env2mfile() { shortopts=( h o ) longopts=( cpu cpu-family cross debarch endian gccsuffix help kernel native subsystem system ) local cur prev if _get_comp_words_by_ref -n ':' cur prev &>/dev/null; then case $prev in --endian) endianness=( big little ) COMPREPLY+=($(compgen -W '${endianness[*]}' -- "$cur")) return ;; -o) _filedir return ;; esac else cur="${COMP_WORDS[COMP_CWORD]}" fi if ! _meson_compgen_options "$cur"; then if [[ -z $cur ]]; then COMPREPLY+=($(compgen -P '--' -W '${longopts[*]}')) COMPREPLY+=($(compgen -P '-' -W '${shortopts[*]}')) fi fi } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3207712 meson-1.9.1/data/shell-completions/zsh/0000755000175000017500000000000015064306100020662 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/shell-completions/zsh/_meson0000644000175000017500000005052115064306076022104 0ustar00eschwartzeschwartz#compdef meson # vim:ts=2 sw=2 # Copyright (c) 2017 Arseny Maslennikov # All rights reserved. Individual authors, whether or not # specifically named, retain copyright in all changes; in what follows, they # are referred to as `the Meson development team'. This is for convenience # only and this body has no legal status. This file is distributed under # the following licence. # # Permission is hereby granted, without written agreement and without # licence or royalty fees, to use, copy, modify, and distribute this # software and to distribute modified versions of this software for any # purpose, provided that the above copyright notice and the following # two paragraphs appear in all copies of this software. # # In no event shall the Meson development team be liable to any party for # direct, indirect, special, incidental, or consequential damages arising out # of the use of this software and its documentation, even if the Meson # development team have been advised of the possibility of such damage. # # The Meson development team specifically disclaim any warranties, including, # but not limited to, the implied warranties of merchantability and fitness # for a particular purpose. The software provided hereunder is on an "as is" # basis, and the Meson development team have no obligation to provide # maintenance, support, updates, enhancements, or modifications. local curcontext="$curcontext" state line local -i ret local __meson_backends="(ninja "${(j. .)${:-vs{,2010,2015,2017,2019,2022}}}" xcode none)" local __meson_build_types="(plain debug debugoptimized minsize release)" local __meson_wrap_modes="(default nofallback nodownload forcefallback nopromote)" local __meson_dist_formats=("xztar" "bztar" "gztar" "zip") local __meson_cd='-C[change into this directory before running]:target dir:_directories' local -a __meson_common=( '--prefix=[installation prefix]: :_directories' '--bindir=[executable directory]: :_directories' '--datadir=[data file directory]: :_directories' '--includedir=[header file directory]: :_directories' '--infodir=[info page directory]: :_directories' '--libdir=[library directory]: :_directories' '--libexecdir=[library executable directory]: :_directories' '--localedir=[locale data directory]: :_directories' '--localstatedir=[local state data directory]: :_directories' '--mandir=[manual page directory]: :_directories' '--sbindir=[system executable directory]: :_directories' '--sharedstatedir=[arch-independent data directory]: :_directories' '--sysconfdir=[system configuration directory]: :_directories' '--auto-features=[default value for auto features]:auto features types:(auto disabled enabled)' '--backend=[backend to use]:Meson backend:'"$__meson_backends" '--buildtype=[build type to use]:Meson build type:'"$__meson_build_types" '--debug[turn on building with debug]' '--default-library=[default library type]:default library type:(shared static both)' '--errorlogs[prints the logs from failing tests]' '--install-umask=[default umask for permissions of all installed files]' '--layout=[build directory layout]:build directory layout:(flat mirror)' '--optimization=[optimization level for compiled targets]:optimization:(0 g 1 2 3 s)' '--stdsplit=[split stdout and stderr in test logs]' '--strip[strip targets on install]' '--unity=[unity builds on/off]:whether to do unity builds:(on off subprojects)' '--warnlevel=[compiler warning level]:compiler warning level:warning level:(1 2 3)' '--werror[treat warnings as errors]' '--wrap-mode=[special wrap mode]:wrap mode:'"$__meson_wrap_modes" '--force-fallback-for=[force fallback for listed subprojects]' '--pkg-config-path=[extra paths for HOST pkg-config to search]:paths:_dir_list -s ,' '--build.pkg-config-path=[extra paths for BUILD pkg-config to search]:paths:_dir_list -s ,' '--cmake-prefix-path=[extra prefixes for HOST cmake to search]:paths:_dir_list -s ,' '--build.cmake-prefix-path=[extra prefix for BUILD cmake to search]:paths:_dir_list -s ,' ) local -a meson_commands=( 'configure:configure a project' 'dist:generate release archive' 'init:create a new project' 'install:install one or more targets' 'introspect:query project properties' 'setup:set up a build directory' 'test:run tests' 'wrap:manage source dependencies' 'subprojects:manage subprojects' 'compile:Build the project' 'rewrite:Modify the project definition' 'devenv:Run commands in developer environment' 'env2mfile:Convert current environment to a cross or native file' 'format:Format meson source file' 'help:Print help of a subcommand' ) (( $+functions[__meson_is_build_dir] )) || __meson_is_build_dir() { local mpd="${1:-$PWD}/meson-private" [[ -f "$mpd/build.dat" && -f "$mpd/coredata.dat" ]] return $? } # TODO: implement build option completion (( $+functions[__meson_build_options] )) || __meson_build_options() {} # `meson introspect` currently can provide that information in JSON. # We can: # 1) pipe its output to python3 -m json.tool | grep "$alovelyregex" | cut <...> # 2) teach mintro.py to use a different output format # (or perhaps just to select the fields printed) (( $+functions[__meson_test_names] )) || __meson_test_names() { local rtests if rtests="$(_call_program meson meson test ${opt_args[-C]:+-C "$opt_args[-C]"} --list)"; then local -a tests=(${(@f)rtests}) _describe -t "tests" "Meson tests" tests else _message -r "current working directory is not a build directory" _message -r 'use -C $build_dir or cd $build_dir' fi } (( $+functions[__meson_wrap_names] )) || __meson_wrap_names() { local rwraps rwraps="$(_call_program meson meson wrap list)" local -a wraps=(${(@f)rwraps}) _describe -t wraps "Meson wraps" wraps } (( $+functions[__meson_installed_wraps] )) || __meson_installed_wraps() { local rwraps if rwraps="$(ls subprojects/ | grep '\.wrap$' | cut -d . -f 1)"; then local -a wraps=(${(@f)rwraps}) _describe -t wraps "Meson wraps" wraps fi } (( $+functions[_meson_commands] )) || _meson_commands() { _describe -t commands "Meson subcommands" meson_commands } (( $+functions[_meson-setup] )) || _meson-setup() { local firstd secondd if [[ -f "meson.build" ]]; then # if there's no second argument on the command line # cwd will implicitly be substituted: # - as the source directory if it has a file with the name "meson.build"; # - as the build directory otherwise # more info in mesonbuild/mesonmain.py firstd="build" secondd="source" else firstd="source" secondd="build" fi _arguments \ '*-D-[set the value of a build option]:build option:__meson_build_options' \ '--cross-file=[cross-compilation environment description]:cross file:_files' \ '--native-file=[build machine compilation environment description]:native file:_files' \ '--clearcache[clear cached state]' \ '--fatal-meson-warnings=[exit when any meson warnings are encountered]' \ '(-v --version)'{'-v','--version'}'[print the meson version and exit]' \ '--reconfigure=[re-run build configuration]' \ '--wipe=[delete saved state and restart using saved command line options]' \ ":$firstd directory:_directories" \ "::$secondd directory:_directories" \ "${(@)__meson_common}" } (( $+functions[_meson-configure] )) || _meson-configure() { local curcontext="$curcontext" # TODO: implement 'mesonconf @file' local -a specs=( '*-D-[set the value of a build option]:build option:__meson_build_options' '::build directory:_directories' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" \ "${(@)__meson_common}" } (( $+functions[_meson-test] )) || _meson-test() { local curcontext="$curcontext" # TODO: complete test suites local -a specs=( '--repeat[number of times to run the tests]:number of times to repeat: ' '--no-rebuild[do not rebuild before running tests]' '--gdb[run tests under gdb]' '--gdb-path=[program to run for gdb (can be wrapper or compatible program)]:program:_path_commands' '(--interactive -i)'{'--interactive','-i'}'[run tests with interactive input/output]' '--list[list available tests]' '(--wrapper --wrap)'{'--wrapper=','--wrap='}'[wrapper to run tests with]:wrapper program:_path_commands' "$__meson_cd" '(--suite)--no-suite[do not run tests from this suite]:test suite: ' '(--no-suite)--suite[only run tests from this suite]:test suite: ' '--no-stdsplit[do not split stderr and stdout in logs]' '--print-errorlogs[print logs for failing tests]' '--benchmark[run benchmarks instead of tests]' '--logbase[base name for log file]:filename: ' '--num-processes[how many threads to use]:number of processes: ' '(--verbose -v)'{'--verbose','-v'}'[do not redirect stdout and stderr]' '(--quiet -q)'{'--quiet','-q'}'[produce less output to the terminal]' '(--timeout-multiplier -t)'{'--timeout-multiplier','-t'}'[a multiplier for test timeouts]:Python floating-point number: ' '--setup[which test setup to use]:test setup: ' '--max-lines[Maximum number of lines to show from a long test log]:Python integer number: ' '--test-args[arguments to pass to the tests]: : ' '*:Meson tests:__meson_test_names' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-install] )) || _meson-install() { local curcontext="$curcontext" local -a specs=( "$__meson_cd" '--no-rebuild[do not rebuild before installing]' '--only-changed[do not overwrite files that are older than the copied file]' '(--quiet -q)'{'--quiet','-q'}'[do not print every file that was installed]' '--destdir[set or override DESTDIR environment]: :_directories' '(--dry-run -d)'{'--dry-run','-d'}'[do not actually install, only print logs]' '--skip-subprojects[do not install files from given subprojects]: : ' '--tags[install only targets having one of the given tags]: :_values -s , tag devel runtime python-runtime man doc i18n typelib bin bin-devel tests systemtap' '--strip[strip targets even if strip option was not set during configure]' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-introspect] )) || _meson-introspect() { local curcontext="$curcontext" local -a specs=( '--ast[dump the ASK of the meson file]' '--benchmarks[list all benchmarks]' '--buildoptions[list all build options]' '--buildsystem-files[list files that belong to the build system]' '--dependencies[list external dependencies]' '--installed[list all installed files and directories]' '--projectinfo[show project information]' '--targets[list top level targets]' '--tests[list all unit tests]' '--backend=[backend to use]:Meson backend:'"$__meson_backends" '::build directory:_directories' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-init] )) || _meson-init() { local curcontext="$curcontext" local -a specs=( "$__meson_cd" '(-n --name)'{'-n','--name'}'=[the name of the project (defaults to directory name)]' '(-e --executable)'{'-e','--executable'}'=[the name of the executable target to create (defaults to project name)]' '(-d --deps)'{'-d','--deps'}'=[comma separated list of dependencies]' '(-l --language)'{'-l','--language'}'=[comma separated list of languages (autodetected based on sources if unset)]:languages:_values -s , language c cpp cs cuda d fortran java objc objcpp rust' '(-b --build)'{'-b','--build'}'[build the project immediately after generation]' '--builddir=[directory for building]:directory:_directories' '(-f --force)'{'-f','--force'}'[overwrite any existing files and directories]' '(-t --type)'{'-t','--type'}'=[project type, defaults to executable]:type:(executable library)' '(-v --version)'{'-v','--version'}'[print the meson version and exit]' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-wrap] )) || _meson-wrap() { local -a commands=( 'list:list all available wraps' 'search:search the db by name' 'install:install the specified project' 'update:Update a project to its newest available version' 'info:Show info about a wrap' 'status:Show the status of your subprojects' ) if (( CURRENT == 2 )); then _describe -t commands "Meson wrap subcommands" commands else local curcontext="$curcontext" cmd="${${commands[(r)$words[2]:*]%%:*}}" if (( $#cmd )); then if [[ $cmd == status ]]; then _message "no options" elif [[ $cmd == "list" ]]; then _arguments '*:meson wraps' elif [[ $cmd == "search" ]]; then _arguments '*:meson wraps' elif [[ $cmd == "install" ]]; then _arguments '*:meson wraps:__meson_wrap_names' elif [[ $cmd == "update" ]]; then _arguments '*:meson wraps:__meson_installed_wraps' elif [[ $cmd == "info" ]]; then _arguments '*:meson wraps:__meson_wrap_name' elif [[ $cmd == "status" ]]; then _arguments '*:' elif [[ $cmd == "promote" ]]; then # TODO: how do you figure out what wraps are provided by subprojects if # they haven't been fetched yet? _arguments '*:' fi else _message "unknown meson wrap command: $words[2]" fi fi } (( $+functions[_meson-dist] )) || _meson-dist() { local curcontext="$curcontext" local -a specs=( '--allow-dirty[Allow even when repository contains uncommitted changes]' '--formats=[comma separated list of archive types to create]:archive formats:_values -s , format '"$__meson_dist_formats" '--include-subprojects[Include source code of subprojects that have been used for the build]' '--no-tests[Do not build and test generated packages]' "$__meson_cd" ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-subprojects-update] )) || _meson-subprojects-update() { local curcontext="$curcontext" local -a specs=( "--rebase[rebase your branch on top of wrap's revision (git only)]" '--sourcedir=[path to source directory]:_directories' '*:subprojects:__meson_installed_wraps' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-subprojects-checkout] )) || _meson-subprojects-checkout() { local curcontext="$curcontext" local -a specs=( '-b[create a new branch]' '--sourcedir=[path to source directory]:_directories' # FIXME: this doesn't work exactly right, but I can't figure it out ':branch name' '*:subprojects:__meson_installed_wraps' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-subprojects-download] )) || _meson-subprojects-download() { local curcontext="$curcontext" local -a specs=( '--sourcedir=[path to source directory]:_directories' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-subprojects-foreach] )) || _meson-subprojects-foreach() { local curcontext="$curcontext" local -a specs=( '--sourcedir=[path to source directory]:_directories' '*:command:_command_names -e' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-subprojects] )) || _meson-subprojects() { local -a commands=( 'update:update all subprojects from wrap files' 'checkout:checkout a branch (git only)' 'download:ensure subprojects are fetched, even if not in use. Already downloaded subprojects are not modified.' 'foreach:execute a command in each subproject directory' ) if (( CURRENT == 2 )); then _describe -t commands "Meson subprojects subcommands" commands else local curcontext="$curcontext" cmd="${${commands[(r)$words[2]:*]%%:*}}" if (( $#cmd )); then if [[ $cmd == status ]]; then _message "no options" else _meson-subprojects-$cmd fi else _message "unknown meson subprojects command: $words[2]" fi fi } (( $+functions[_meson-compile] )) || _meson-compile() { local curcontext="$curcontext" local -a specs=( "$__meson_cd" '--clean[Clean the build directory]' '(-j --jobs)'{'-j','--jobs'}'=[the number of work jobs to run (if supported)]:_guard "[0-9]#" "number of jobs"' '(-l --load-average)'{'-l','--load-average'}'=[the system load average to try to maintain (if supported)]:_guard "[0-9]#" "load average"' '(-v --verbose)'{'-v','--verbose'}'[Show more output]' '--ninja-args=[Arguments to pass to ninja (only when using ninja)]' '--vs-args=[Arguments to pass to vs (only when using msbuild)]' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } # TODO: implement rewrite sub-commands properly (( $+functions[_meson-rewrite-target] )) || _meson-rewrite-target() { _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ } (( $+functions[_meson-rewrite-kwargs] )) || _meson-rewrite-kwargs() { _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ } (( $+functions[_meson-rewrite-default-options] )) || _meson-rewrite-default-options() { _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ } (( $+functions[_meson-rewrite-command] )) || _meson-rewrite-command() { _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ } (( $+functions[_meson-rewrite] )) || _meson-rewrite() { local -a commands=( 'target:Modify a target' 'kwargs:Modify keyword arguments' 'default-options:Modify the project default options' 'command:Execute a JSON array of commands' ) if (( CURRENT == 2 )); then _describe -t commands "Meson rewrite subcommands" commands else local curcontext="$curcontext" cmd="${${commands[(r)$words[2]:*]%%:*}}" if [[ $cmd == status ]]; then _message "no options" else _meson-rewrite-$cmd fi fi } (( $+functions[_meson-devenv] )) || _meson-devenv() { local curcontext="$curcontext" local -a specs=( "$__meson_cd" '--clean=[Clean the build directory]' '(-w workdir)'{'-w','--workdir'}'=[Directory to cd into before running (default: builddir, Since 1.0.0)]:target dir:_directories' '--dump=[Only print required environment (Since 0.62.0) Takes an optional file path (Since 1.1.0)]:dump path:_files' '--dump-format=[Format used with --dump (Since 1.1.0)]:format:(sh export vscode)' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-env2mfile] )) || _meson-env2mfile() { local curcontext="$curcontext" local -a specs=( '--debarch=[The dpkg architecture to generate.]' '--gccsuffix=[A particular gcc version suffix if necessary.]' '-o=[The output file.]:file:_files' '--cross=[Generate a cross compilation file.]' '--native=[Generate a native compilation file.]' '--system=[Define system for cross compilation.]' '--subsystem=[Define subsystem for cross compilation.]' '--kernel=[Define kernel for cross compilation.]' '--cpu=[Define cpu for cross compilation.]' '--cpu-family=[Define cpu family for cross compilation.]' '--endian=[Define endianness for cross compilation.]:endianness:(big little)' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } (( $+functions[_meson-format] )) || _meson-format() { local curcontext="$curcontext" local -a specs=( '(-q --check-only)'{'-q','--check-only'}'=[exit with 1 if files would be modified by meson format]' '(-i --inplace)'{'-i','--inplace'}'=[format files in-place]' '(-r --recursive)'{'-r','--recursive'}'=[recurse subdirs (requires --check-only or --inplace option)]' '(-c --configuration)'{'-c','--configuration'}'=[read configuration from meson.format]' '(-e --editor-config)'{'-e','--editor-config'}'=[try to read configuration from .editorconfig]' '(-o --output)'{'-o','--output'}'=[output file (implies having exactly one input)]' ) _arguments \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ "${(@)specs}" } if [[ $service != meson ]]; then _call_function ret _$service return ret fi _arguments -C -R \ '(: -)'{'--help','-h'}'[show a help message and quit]' \ '(: -)'{'--version','-v'}'[show version information and quit]' \ '(-): :_meson_commands' \ '*:: :->post-command' \ # ret=$? [[ $ret = 300 ]] && case "$state" in post-command) service="meson-$words[1]" curcontext=${curcontext%:*:*}:$service: _call_function ret _$service ;; esac return ret ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.1974998 meson-1.9.1/data/syntax-highlighting/0000755000175000017500000000000015064306100020406 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3208702 meson-1.9.1/data/syntax-highlighting/vim/0000755000175000017500000000000015064306100021201 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/syntax-highlighting/vim/README0000644000175000017500000000020515064306076022072 0ustar00eschwartzeschwartzftdetect sets the filetype ftplugin sets Meson indentation rules indent does Meson indentation syntax does Meson syntax highlighting ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3209617 meson-1.9.1/data/syntax-highlighting/vim/ftdetect/0000755000175000017500000000000015064306100023003 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/syntax-highlighting/vim/ftdetect/meson.vim0000644000175000017500000000033015064306076024651 0ustar00eschwartzeschwartzau BufNewFile,BufRead meson.build set filetype=meson au BufNewFile,BufRead meson.options set filetype=meson au BufNewFile,BufRead meson_options.txt set filetype=meson au BufNewFile,BufRead *.wrap set filetype=dosini ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3210394 meson-1.9.1/data/syntax-highlighting/vim/ftplugin/0000755000175000017500000000000015064306100023031 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/syntax-highlighting/vim/ftplugin/meson.vim0000644000175000017500000000217215064306076024705 0ustar00eschwartzeschwartz" Vim filetype plugin file " Language: meson " License: VIM License " Maintainer: Liam Beguin " Original Author: Laurent Pinchart " Last Change: 2018 Nov 27 if exists("b:did_ftplugin") | finish | endif let b:did_ftplugin = 1 let s:keepcpo= &cpo set cpo&vim setlocal commentstring=#\ %s setlocal comments=:# setlocal formatoptions+=croql formatoptions-=t let b:undo_ftplugin = "setl com< cms< fo<" if get(g:, "meson_recommended_style", 1) setlocal expandtab setlocal shiftwidth=2 setlocal softtabstop=2 let b:undo_ftplugin .= " | setl et< sts< sw<" endif if exists("loaded_matchit") && !exists("b:match_words") let b:match_words = '\:\:\:\,' . \ '\:\:\:\' let b:undo_ftplugin .= " | unlet! b:match_words" endif if (has("gui_win32") || has("gui_gtk")) && !exists("b:browsefilter") let b:browsefilter = "Meson Build Files (meson.build)\tmeson.build\n" . \ "All Files (*.*)\t*.*\n" let b:undo_ftplugin .= " | unlet! b:browsefilter" endif let &cpo = s:keepcpo unlet s:keepcpo ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3211293 meson-1.9.1/data/syntax-highlighting/vim/indent/0000755000175000017500000000000015064306100022462 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/syntax-highlighting/vim/indent/meson.vim0000644000175000017500000001230715064306076024337 0ustar00eschwartzeschwartz" Vim indent file " Language: Meson " License: VIM License " Maintainer: Nirbheek Chauhan " Liam Beguin " Original Authors: David Bustos " Bram Moolenaar " Last Change: 2015 Feb 23 " Only load this indent file when no other was loaded. if exists("b:did_indent") finish endif let b:did_indent = 1 " Some preliminary settings setlocal nolisp " Make sure lisp indenting doesn't supersede us setlocal autoindent " indentexpr isn't much help otherwise setlocal indentexpr=GetMesonIndent(v:lnum) setlocal indentkeys+==elif,=else,=endforeach,=endif,0) let b:undo_indent = "setl ai< inde< indk< lisp<" " Only define the function once. if exists("*GetMesonIndent") finish endif let s:keepcpo= &cpo set cpo&vim " Come here when loading the script the first time. let s:maxoff = 50 " maximum number of lines to look backwards for () function GetMesonIndent(lnum) echom getline(line(".")) " If this line is explicitly joined: If the previous line was also joined, " line it up with that one, otherwise add two 'shiftwidth' if getline(a:lnum - 1) =~ '\\$' if a:lnum > 1 && getline(a:lnum - 2) =~ '\\$' return indent(a:lnum - 1) endif return indent(a:lnum - 1) + (exists("g:mesonindent_continue") ? eval(g:mesonindent_continue) : (shiftwidth() * 2)) endif " If the start of the line is in a string don't change the indent. if has('syntax_items') \ && synIDattr(synID(a:lnum, 1, 1), "name") =~ "String$" return -1 endif " Search backwards for the previous non-empty line. let plnum = prevnonblank(v:lnum - 1) if plnum == 0 " This is the first non-empty line, use zero indent. return 0 endif " If the previous line is inside parenthesis, use the indent of the starting " line. " Trick: use the non-existing "dummy" variable to break out of the loop when " going too far back. call cursor(plnum, 1) let parlnum = searchpair('(\|{\|\[', '', ')\|}\|\]', 'nbW', \ "line('.') < " . (plnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") if parlnum > 0 let plindent = indent(parlnum) let plnumstart = parlnum else let plindent = indent(plnum) let plnumstart = plnum endif " When inside parenthesis: If at the first line below the parenthesis add " a 'shiftwidth', otherwise same as previous line. " i = (a " + b " + c) call cursor(a:lnum, 1) let p = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") if p > 0 if p == plnum " When the start is inside parenthesis, only indent one 'shiftwidth'. let pp = searchpair('(\|{\|\[', '', ')\|}\|\]', 'bW', \ "line('.') < " . (a:lnum - s:maxoff) . " ? dummy :" \ . " synIDattr(synID(line('.'), col('.'), 1), 'name')" \ . " =~ '\\(Comment\\|Todo\\|String\\)$'") if pp > 0 return indent(plnum) + (exists("g:pyindent_nested_paren") ? eval(g:pyindent_nested_paren) : shiftwidth()) endif return indent(plnum) + (exists("g:pyindent_open_paren") ? eval(g:pyindent_open_paren) : shiftwidth()) endif if plnumstart == p return indent(plnum) endif return plindent endif " Get the line and remove a trailing comment. " Use syntax highlighting attributes when possible. let pline = getline(plnum) let pline_len = strlen(pline) if has('syntax_items') " If the last character in the line is a comment, do a binary search for " the start of the comment. synID() is slow, a linear search would take " too long on a long line. if synIDattr(synID(plnum, pline_len, 1), "name") =~ "\\(Comment\\|Todo\\)$" let min = 1 let max = pline_len while min < max let col = (min + max) / 2 if synIDattr(synID(plnum, col, 1), "name") =~ "\\(Comment\\|Todo\\)$" let max = col else let min = col + 1 endif endwhile let pline = strpart(pline, 0, min - 1) endif else let col = 0 while col < pline_len if pline[col] == '#' let pline = strpart(pline, 0, col) break endif let col = col + 1 endwhile endif " If the previous line ended the conditional/loop if getline(plnum) =~ '^\s*\(endif\|endforeach\)\>\s*' " Maintain indent return -1 endif " If the previous line ended with a builtin, indent this line if pline =~ '^\s*\(foreach\|if\|else\|elif\)\>\s*' return plindent + shiftwidth() endif " If the current line begins with a header keyword, deindent if getline(a:lnum) =~ '^\s*\(else\|elif\|endif\|endforeach\)' " Unless the previous line was a one-liner if getline(plnumstart) =~ '^\s*\(foreach\|if\)\>\s*' return plindent endif " Or the user has already dedented if indent(a:lnum) <= plindent - shiftwidth() return -1 endif return plindent - shiftwidth() endif " When after a () construct we probably want to go back to the start line. " a = (b " + c) " here if parlnum > 0 return plindent endif return -1 endfunction let &cpo = s:keepcpo unlet s:keepcpo " vim:sw=2 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3212075 meson-1.9.1/data/syntax-highlighting/vim/syntax/0000755000175000017500000000000015064306100022527 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/syntax-highlighting/vim/syntax/meson.vim0000644000175000017500000000767615064306076024421 0ustar00eschwartzeschwartz" Vim syntax file " Language: Meson " License: VIM License " Maintainer: Nirbheek Chauhan " Liam Beguin " Last Change: 2023 Aug 27 " Credits: Zvezdan Petkovic " Neil Schemenauer " Dmitry Vasiliev " " This version is copied and edited from python.vim " It's very basic, and doesn't do many things I'd like it to " For instance, it should show errors for syntax that is valid in " Python but not in Meson. " " Optional highlighting can be controlled using these variables. " " let meson_space_error_highlight = 1 " if exists("b:current_syntax") finish endif " We need nocompatible mode in order to continue lines with backslashes. " Original setting will be restored. let s:cpo_save = &cpo set cpo&vim " http://mesonbuild.com/Syntax.html syn keyword mesonConditional elif else if endif syn keyword mesonRepeat foreach endforeach syn keyword mesonOperator and not or in syn keyword mesonStatement continue break syn match mesonComment "#.*$" contains=mesonTodo,@Spell syn keyword mesonTodo FIXME NOTE NOTES TODO XXX contained " Strings can either be single quoted or triple counted across multiple lines, " but always with a ' syn region mesonString \ start="\z('\)" end="\z1" skip="\\\\\|\\\z1" \ contains=mesonEscape,@Spell syn region mesonString \ start="\z('''\)" end="\z1" keepend \ contains=mesonEscape,mesonSpaceError,@Spell syn match mesonEscape "\\[abfnrtv'\\]" contained syn match mesonEscape "\\\o\{1,3}" contained syn match mesonEscape "\\x\x\{2}" contained syn match mesonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained " Meson allows case-insensitive Unicode IDs: http://www.unicode.org/charts/ syn match mesonEscape "\\N{\a\+\%(\s\a\+\)*}" contained syn match mesonEscape "\\$" " Meson only supports integer numbers " http://mesonbuild.com/Syntax.html#numbers syn match mesonNumber "\<\d\+\>" syn match mesonNumber "\<0x\x\+\>" syn match mesonNumber "\<0o\o\+\>" " booleans syn keyword mesonBoolean false true " Built-in functions syn keyword mesonBuiltin \ build_machine \ host_machine \ meson \ option \ target_machine \ add_global_arguments \ add_global_link_arguments \ add_languages \ add_project_arguments \ add_project_dependencies \ add_project_link_arguments \ add_test_setup \ alias_target \ assert \ benchmark \ both_libraries \ build_target \ configuration_data \ configure_file \ custom_target \ debug \ declare_dependency \ dependency \ disabler \ environment \ error \ executable \ files \ find_program \ generator \ get_option \ get_variable \ import \ include_directories \ install_data \ install_emptydir \ install_headers \ install_man \ install_subdir \ install_symlink \ is_disabler \ is_variable \ jar \ join_paths \ library \ message \ project \ range \ run_command \ run_target \ set_variable \ shared_library \ shared_module \ static_library \ structured_sources \ subdir \ subdir_done \ subproject \ summary \ test \ unset_variable \ vcs_tag \ warning if exists("meson_space_error_highlight") " trailing whitespace syn match mesonSpaceError display excludenl "\s\+$" " mixed tabs and spaces syn match mesonSpaceError display " \+\t" syn match mesonSpaceError display "\t\+ " endif " The default highlight links. Can be overridden later. hi def link mesonStatement Statement hi def link mesonConditional Conditional hi def link mesonRepeat Repeat hi def link mesonOperator Operator hi def link mesonComment Comment hi def link mesonTodo Todo hi def link mesonString String hi def link mesonEscape Special hi def link mesonNumber Number hi def link mesonBuiltin Function hi def link mesonBoolean Boolean if exists("meson_space_error_highlight") hi def link mesonSpaceError Error endif let b:current_syntax = "meson" let &cpo = s:cpo_save unlet s:cpo_save " vim:set sw=2 sts=2 ts=8 noet: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/data/test.schema.json0000644000175000017500000001007315064306076017543 0ustar00eschwartzeschwartz{ "type": "object", "additionalProperties": false, "properties": { "env": { "type": "object", "additionalProperties": { "type": "string" } }, "installed": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "file": { "type": "string" }, "type": { "type": "string", "enum": [ "file", "python_file", "dir", "exe", "shared_lib", "python_lib", "python_limited_lib", "python_bytecode", "pdb", "implib", "py_implib", "py_limited_implib", "implibempty", "expr", "link" ] }, "platform": { "type": "string", "enum": [ "msvc", "gcc", "cygwin", "!cygwin" ] }, "version": { "type": "string" }, "language": { "type": "string" } }, "required": [ "file", "type" ] } }, "matrix": { "type": "object", "properties": { "options": { "additionalProperties": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "val": { "type": ["string", "boolean", "null", "array"], "items": { "type": "string" } }, "compilers": { "type": "object", "additionalProperties": { "type": "string" } }, "skip_on_env": { "type": "array", "items": { "type": "string" } }, "expect_skip_on_jobname": { "type": "array", "items": { "type": "string" } }, "expect_skip_on_os": { "type": "array", "items": { "type": "string" } } }, "required": [ "val" ] } }, "exclude": { "type": "array", "items": { "type": "object", "additionalProperties": { "type": ["string", "boolean", "array"], "items": { "type": "string" } } } } } } }, "do_not_set_opts": { "type": "array", "items": { "type": "string", "enum": [ "libdir", "prefix" ] } }, "tools": { "type": "object" }, "stdout": { "type": "array", "items": { "type": "object", "additionalProperties": false, "properties": { "line": { "type": "string" }, "match": { "type": "string", "enum": [ "literal", "re" ] }, "count": { "type": "integer" }, "comment": { "type": "string" } }, "required": [ "line" ] } }, "skip_on_env": { "type": "array", "items": { "type": "string" } }, "expect_skip_on_jobname": { "type": "array", "items": { "type": "string" } }, "expect_skip_on_os": { "type": "array", "items": { "type": "string" } }, "cleanup": { "type": "array", "items": { "type": "string" } } } } ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3218904 meson-1.9.1/docs/0000755000175000017500000000000015064306100014434 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/.editorconfig0000644000175000017500000000004115064306076017120 0ustar00eschwartzeschwartz[sitemap.txt] indent_style = tab ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/README.md0000644000175000017500000000153015064306076015726 0ustar00eschwartzeschwartz# Meson Documentation ## Build dependencies Meson uses itself and [hotdoc](https://github.com/hotdoc/hotdoc) for generating documentation. Minimum required version of hotdoc is *0.8.9*. Instructions on how to install hotdoc are [here](https://hotdoc.github.io/installing.html). Our custom hotdoc extensions require: - [chevron](https://pypi.org/project/chevron) - [strictyaml](https://pypi.org/project/strictyaml) ## Building the documentation From the Meson repository root dir: ``` $ cd docs/ $ meson setup built_docs/ $ ninja -C built_docs/ ``` Now you should be able to open the documentation locally ``` built_docs/Meson documentation-doc/html/index.html ``` ## Upload Meson uses the git-upload hotdoc plugin which basically removes the html pages and replaces with the new content. You can simply run: ``` $ ninja -C built_docs/ upload ``` ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3219635 meson-1.9.1/docs/extensions/0000755000175000017500000000000015064306100016633 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/extensions/refman_links.py0000644000175000017500000001256615064306076021703 0ustar00eschwartzeschwartzfrom pathlib import Path from json import loads import os import re from hotdoc.core.exceptions import HotdocSourceException from hotdoc.core.extension import Extension from hotdoc.core.tree import Page from hotdoc.core.project import Project from hotdoc.core.symbols import * from hotdoc.run_hotdoc import Application from hotdoc.core.formatter import Formatter from hotdoc.utils.loggable import Logger, warn, info import typing as T if T.TYPE_CHECKING: import argparse Logger.register_warning_code('unknown-refman-link', HotdocSourceException, 'refman-links') class RefmanLinksExtension(Extension): extension_name = 'refman-links' argument_prefix = 'refman' def __init__(self, app: Application, project: Project): self.project: Project super().__init__(app, project) self._data_file: T.Optional[Path] = None self._data: T.Dict[str, str] = {} @staticmethod def add_arguments(parser: 'argparse.ArgumentParser'): group = parser.add_argument_group( 'Refman links', 'Custom Meson extension', ) # Add Arguments with `group.add_argument(...)` group.add_argument( f'--refman-data-file', help="JSON file with the mappings to replace", default=None, ) def parse_config(self, config: T.Dict[str, T.Any]) -> None: super().parse_config(config) self._data_file = config.get('refman_data_file') def _formatting_page_cb(self, formatter: Formatter, page: Page) -> None: ''' Replace Meson refman tags Links of the form [[function]] are automatically replaced with valid links to the correct URL. To reference objects / types use the [[@object]] syntax. ''' for key, value in self._data.items(): path = os.path.relpath(value, self.app.config.get_invoke_dir()).split('#')[0] if path == page.link.ref: if key.startswith('@'): res = self.create_symbol( ClassSymbol, display_name=key[1:], filename=path, unique_name=key) res.link = Link(value, res.display_name, res.unique_name) elif '.' in key: res = self.create_symbol( MethodSymbol, parameters=[], display_name=key.split('.')[-1], parent_name=f'@{key.split(".")[-2]}', filename=path, unique_name=key) res.link = Link(value, key, res.unique_name) else: res = self.create_symbol( FunctionSymbol, parameters=[], display_name=key, filename=path, unique_name=key) res.link = Link(value, res.display_name, res.unique_name) page.symbols.append(res) link_regex = re.compile(r'(\[\[#?@?([ \n\t]*[a-zA-Z0-9_]+[ \n\t]*\.)*[ \n\t]*[a-zA-Z0-9_]+[ \n\t]*\]\])(.)?', re.MULTILINE) for m in link_regex.finditer(page.formatted_contents): i = m.group(1) obj_id: str = i[2:-2] obj_id = re.sub(r'[ \n\t]', '', obj_id) # Remove whitespaces # Marked as inside a code block? in_code_block = False if obj_id.startswith('#'): in_code_block = True obj_id = obj_id[1:] if obj_id not in self._data: warn('unknown-refman-link', f'{Path(page.name).name}: Unknown Meson refman link: "{obj_id}"') continue # Just replaces [[!file.id]] paths with the page file (no fancy HTML) if obj_id.startswith('!'): page.formatted_contents = page.formatted_contents.replace(i, self._data[obj_id]) continue # Fancy links for functions and methods text = obj_id if text.startswith('@'): text = text[1:] elif in_code_block: if m.group(3) != '(': text = text + '()' else: text = text + '()' if not in_code_block: text = f'{text}' link = f'{text}' page.formatted_contents = page.formatted_contents.replace(i, link, 1) def setup(self) -> None: super().setup() if not self._data_file: info('Meson refman extension DISABLED') return raw = Path(self._data_file).read_text(encoding='utf-8') self._data = loads(raw) # Register formatter for ext in self.project.extensions.values(): ext = T.cast(Extension, ext) ext.formatter.formatting_page_signal.connect(self._formatting_page_cb) info('Meson refman extension LOADED') def create_symbol(self, *args, **kwargs): kwargs['language'] = 'meson' return super(RefmanLinksExtension, self).create_symbol(*args, **kwargs) @staticmethod def get_dependencies() -> T.List[T.Type[Extension]]: return [] # In case this extension has dependencies on other extensions def get_extension_classes() -> T.List[T.Type[Extension]]: return [RefmanLinksExtension] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/genrefman.py0000755000175000017500000000057215064306076016773 0ustar00eschwartzeschwartz#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # Copyright 2021 The Meson development team # Hack to make relative imports to mlog possible from pathlib import Path import sys root = Path(__file__).absolute().parents[1] sys.path.insert(0, str(root)) # Now run the actual code from refman.main import main if __name__ == '__main__': raise SystemExit(main()) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/genrelnotes.py0000755000175000017500000000644115064306076017357 0ustar00eschwartzeschwartz#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # Copyright 2019 The Meson development team ''' Generates release notes for new releases of Meson build system ''' import argparse import subprocess import re import shutil import datetime from pathlib import Path RELNOTE_TEMPLATE = '''--- title: Release {} short-description: Release notes for {} ... # New features{} ''' def add_to_sitemap(sitemap, output_sitemap): ''' Adds release note entry to sitemap.txt. ''' sitemapfile = Path(sitemap) with sitemapfile.open(encoding='utf-8') as s_f: lines = s_f.readlines() relnotes = None to_version = None output = Path(output_sitemap) output.parent.mkdir(exist_ok=True, parents=True) with output.open('w', encoding='utf-8') as s_f: for line in lines: if relnotes is None: m = re.match(r'[\s]*Release-notes-for-([0-9]+)\.([0-9]+)\.([0-9]+)\.md', line) if m: from_version = f'{m[1]}.{m[2]}.{m[3]}' if from_version == '0.64.0': to_version = '1.0.0' else: to_version = f'{m[1]}.{int(m[2]) + 1}.{m[3]}' new_line = line.replace(from_version, to_version) relnotes = new_line.strip() s_f.write(new_line) s_f.write(line) if sitemapfile == output: subprocess.check_call(['git', 'add', output]) return relnotes, to_version def generate(relnotes, to_version, source_dir, output_dir): ''' Generate notes for Meson build next release. ''' title_suffix = ' (in development)' if output_dir else '' title = f'{to_version}{title_suffix}' output = Path(output_dir, relnotes) if output_dir else Path('markdown', relnotes) output.parent.mkdir(exist_ok=True, parents=True) with output.open('w', encoding='utf-8') as ofile: ofile.write(RELNOTE_TEMPLATE.format(title, to_version, title_suffix)) if not output_dir: date = datetime.date.today() date_str = date.strftime("%d %B %Y") ofile.write(f'Meson {to_version} was released on {date_str}\n') for snippetfile in sorted(Path(source_dir, 'markdown/snippets').glob('*.md')): snippet = snippetfile.read_text(encoding='utf-8') ofile.write(snippet) if not snippet.endswith('\n'): ofile.write('\n') ofile.write('\n') if not output_dir: subprocess.check_call(['git', 'rm', 'markdown/snippets/*.md']) subprocess.check_call(['git', 'add', output]) if __name__ == '__main__': parser = argparse.ArgumentParser(description='Generate meson docs') parser.add_argument('--input-sitemap', default='sitemap.txt') parser.add_argument('--output-sitemap', default='sitemap.txt') parser.add_argument('--source-dir', default='.') parser.add_argument('--output-dir') args = parser.parse_args() if Path(args.source_dir, 'markdown/snippets').glob('*.md'): relnotes, to_version = add_to_sitemap(args.input_sitemap, args.output_sitemap) generate(relnotes, to_version, args.source_dir, args.output_dir) elif args.input_sitemap != args.output_sitemap: shutil.copyfile(args.input_sitemap, args.output_sitemap) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/jsonvalidator.py0000755000175000017500000002023315064306076017704 0ustar00eschwartzeschwartz#!/usr/bin/env python3 # SPDX-License-Identifier: Apache-2.0 # Copyright 2021 The Meson development team import argparse import json from pathlib import Path from copy import deepcopy import typing as T T_None = type(None) # Global root object root: dict def assert_has_typed_keys(path: str, data: dict, keys: T.Dict[str, T.Any]) -> dict: assert set(data.keys()).issuperset(keys.keys()), f'{path}: DIFF: {set(data.keys()).difference(keys.keys())}' res = dict() for key, val in keys.items(): cur = data.pop(key) assert isinstance(cur, val), f'{path}: type({key}: {cur}) != {val}' res[key] = cur return res def validate_base_obj(path: str, name: str, obj: dict) -> None: expected: T.Dict[str, T.Any] = { 'name': str, 'description': str, 'since': (str, T_None), 'deprecated': (str, T_None), 'notes': list, 'warnings': list, } cur = assert_has_typed_keys(f'{path}.{name}', obj, expected) assert cur['name'], f'{path}.{name}' assert cur['description'], f'{path}.{name}' assert cur['name'] == name, f'{path}.{name}' assert all(isinstance(x, str) and x for x in cur['notes']), f'{path}.{name}' assert all(isinstance(x, str) and x for x in cur['warnings']), f'{path}.{name}' def validate_type(path: str, typ: dict) -> None: expected: T.Dict[str, T.Any] = { 'obj': str, 'holds': list, } cur = assert_has_typed_keys(path, typ, expected) assert not typ, f'{path} has extra keys: {typ.keys()}' assert cur['obj'] in root['objects'], path for i in cur['holds']: validate_type(path, i) def validate_arg(path: str, name: str, arg: dict) -> None: validate_base_obj(path, name, arg) expected: T.Dict[str, T.Any] = { 'type': list, 'type_str': str, 'required': bool, 'default': (str, T_None), 'min_varargs': (int, T_None), 'max_varargs': (int, T_None), } cur = assert_has_typed_keys(f'{path}.{name}', arg, expected) assert not arg, f'{path}.{name} has extra keys: {arg.keys()}' assert cur['type'], f'{path}.{name}' assert cur['type_str'], f'{path}.{name}' for i in cur['type']: validate_type(f'{path}.{name}', i) if cur['min_varargs'] is not None: assert cur['min_varargs'] > 0, f'{path}.{name}' if cur['max_varargs'] is not None: assert cur['max_varargs'] > 0, f'{path}.{name}' def validate_function(path: str, name: str, func: dict) -> None: validate_base_obj(path, name, func) expected: T.Dict[str, T.Any] = { 'returns': list, 'returns_str': str, 'example': (str, T_None), 'posargs': dict, 'optargs': dict, 'kwargs': dict, 'varargs': (dict, T_None), 'arg_flattening': bool, } cur = assert_has_typed_keys(f'{path}.{name}', func, expected) assert not func, f'{path}.{name} has extra keys: {func.keys()}' assert cur['returns'], f'{path}.{name}' assert cur['returns_str'], f'{path}.{name}' for i in cur['returns']: validate_type(f'{path}.{name}', i) for k, v in cur['posargs'].items(): validate_arg(f'{path}.{name}', k, v) for k, v in cur['optargs'].items(): validate_arg(f'{path}.{name}', k, v) for k, v in cur['kwargs'].items(): validate_arg(f'{path}.{name}', k, v) if cur['varargs']: validate_arg(f'{path}.{name}', cur['varargs']['name'], cur['varargs']) def validate_object(path: str, name: str, obj: dict) -> None: validate_base_obj(path, name, obj) expected: T.Dict[str, T.Any] = { 'example': (str, T_None), 'object_type': str, 'methods': dict, 'is_container': bool, 'extends': (str, T_None), 'returned_by': list, 'extended_by': list, 'defined_by_module': (str, T_None), } cur = assert_has_typed_keys(f'{path}.{name}', obj, expected) assert not obj, f'{path}.{name} has extra keys: {obj.keys()}' for key, val in cur['methods'].items(): validate_function(f'{path}.{name}', key, val) if cur['extends'] is not None: assert cur['extends'] in root['objects'], f'{path}.{name}' assert all(isinstance(x, str) for x in cur['returned_by']), f'{path}.{name}' assert all(isinstance(x, str) for x in cur['extended_by']), f'{path}.{name}' assert all(x in root['objects'] for x in cur['extended_by']), f'{path}.{name}' if cur['defined_by_module'] is not None: assert cur['defined_by_module'] in root['objects'], f'{path}.{name}' assert cur['object_type'] == 'RETURNED', f'{path}.{name}' assert root['objects'][cur['defined_by_module']]['object_type'] == 'MODULE', f'{path}.{name}' assert name in root['objects_by_type']['modules'][cur['defined_by_module']], f'{path}.{name}' return assert cur['object_type'] in {'ELEMENTARY', 'BUILTIN', 'MODULE', 'RETURNED'}, f'{path}.{name}' if cur['object_type'] == 'ELEMENTARY': assert name in root['objects_by_type']['elementary'], f'{path}.{name}' if cur['object_type'] == 'BUILTIN': assert name in root['objects_by_type']['builtins'], f'{path}.{name}' if cur['object_type'] == 'RETURNED': assert name in root['objects_by_type']['returned'], f'{path}.{name}' if cur['object_type'] == 'MODULE': assert name in root['objects_by_type']['modules'], f'{path}.{name}' def main() -> int: global root parser = argparse.ArgumentParser(description='Meson JSON docs validator') parser.add_argument('doc_file', type=Path, help='The JSON docs to validate') args = parser.parse_args() root_tmp = json.loads(args.doc_file.read_text(encoding='utf-8')) root = deepcopy(root_tmp) assert isinstance(root, dict) expected: T.Dict[str, T.Any] = { 'version_major': int, 'version_minor': int, 'meson_version': str, 'functions': dict, 'objects': dict, 'objects_by_type': dict, } cur = assert_has_typed_keys('root', root_tmp, expected) assert not root_tmp, f'root has extra keys: {root_tmp.keys()}' refs = cur['objects_by_type'] expected = { 'elementary': list, 'builtins': list, 'returned': list, 'modules': dict, } assert_has_typed_keys(f'root.objects_by_type', refs, expected) assert not refs, f'root.objects_by_type has extra keys: {refs.keys()}' assert all(isinstance(x, str) for x in root['objects_by_type']['elementary']) assert all(isinstance(x, str) for x in root['objects_by_type']['builtins']) assert all(isinstance(x, str) for x in root['objects_by_type']['returned']) assert all(isinstance(x, str) for x in root['objects_by_type']['modules']) assert all(x in root['objects'] for x in root['objects_by_type']['elementary']) assert all(x in root['objects'] for x in root['objects_by_type']['builtins']) assert all(x in root['objects'] for x in root['objects_by_type']['returned']) assert all(x in root['objects'] for x in root['objects_by_type']['modules']) assert all(root['objects'][x]['object_type'] == 'ELEMENTARY' for x in root['objects_by_type']['elementary']) assert all(root['objects'][x]['object_type'] == 'BUILTIN' for x in root['objects_by_type']['builtins']) assert all(root['objects'][x]['object_type'] == 'RETURNED' for x in root['objects_by_type']['returned']) assert all(root['objects'][x]['object_type'] == 'MODULE' for x in root['objects_by_type']['modules']) # Check that module references are correct assert all(all(isinstance(x, str) for x in v) for k, v in root['objects_by_type']['modules'].items()) assert all(all(x in root['objects'] for x in v) for k, v in root['objects_by_type']['modules'].items()) assert all(all(root['objects'][x]['defined_by_module'] == k for x in v) for k, v in root['objects_by_type']['modules'].items()) for key, val in cur['functions'].items(): validate_function('root', key, val) for key, val in cur['objects'].items(): validate_object('root', key, val) return 0 if __name__ == '__main__': raise SystemExit(main()) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1758563392.3343832 meson-1.9.1/docs/markdown/0000755000175000017500000000000015064306100016256 5ustar00eschwartzeschwartz././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/ARM-performance-test.md0000644000175000017500000000716615064306076022521 0ustar00eschwartzeschwartz# Arm performance test Performance differences in build systems become more apparent on slower platforms. To examine this difference we compared the performance of Meson with GNU Autotools. We took the GLib software project and rewrote its build setup with Meson. GLib was chosen because it is a relatively large C code base which requires lots of low level configuration. The Meson version of the build system is not fully equivalent to the original Autotools one. It does not do all the same configuration steps and does not build all the same targets. The biggest missing piece being internationalisation support with Gettext. However it does configure the system enough to build all C source and run all unit tests. All measurements were done on a Nexus 4 smart phone running the latest Ubuntu touch image (updated on September 9th 2013). Measurements ------ The first thing we measured was the time it took to run the configure step. ![GLib config time](images/glib_conf.png) Meson takes roughly 20 seconds whereas Autotools takes 220. This is a difference of one order of magnitude. Autotools' time contains both autogen and configure. Again it should be remembered that Meson does not do all the configure steps that Autotools does. It does do about 90% of them and it takes just 10% of the time to do it. Then we measured the build times. Two parallel compilation processes were used for both systems. ![GLib build time](images/glib_build.png) On desktop machines Ninja based build systems are 10-20% faster than Make based ones. On this platform the difference grows to 50%. The difference is probably caused by Make's inefficient disk access patterns. Ninja is better at keeping both cores running all the time which yields impressive performance improvements. ![GLib no-op time](images/glib_empty.png) Next we measured the "empty build" case. That is, how long does it take for the build system to detect that no changes need to be made. This is one of the most important metrics of build systems because it places a hard limit on how fast you can iterate on your code. Autotools takes 14 seconds to determine that no work needs to be done. Meson (or, rather, Ninja) takes just one quarter of a second. ![GLib link time](images/glib_link.png) One step which takes quite a lot of time is linking. A common case is that you are working on a library and there are tens of small test executables that link to it. Even if the compilation step would be fast, relinking all of the test executables takes time. It is common for people to manually compile only one test application with a command such as `make sometest` rather than rebuild everything. Meson has an optimization for this case. Whenever a library is rebuilt, Meson inspects the ABI it exports. If it has not changed, Meson will skip all relinking steps as unnecessary. The difference this makes can be clearly seen in the chart above. In that test the source was fully built, then the file `glib/gbytes.c` was touched to force the rebuild of the base glib shared library. As can be seen, Autotools then relinks all test executables that link with glib. Since Meson can detect that the ABI is the same it can skip those steps. The end result being that Meson is almost one hundred times faster on this very common use case. Conclusions ----- One of the main drawbacks of C and C++ compared to languages such as Java are long compilation times. However at least some of the blame can be found in the build tools used rather than the languages themselves or their compilers. Choosing proper tools can bring C and C++ compilation very close to instantaneous rebuilds. This has a direct impact on programmer productivity. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Adding-arguments.md0000644000175000017500000000430615064306076022010 0ustar00eschwartzeschwartz--- short-description: Adding compiler arguments ... # Adding arguments Often you need to specify extra compiler arguments. Meson provides two different ways to achieve this: global arguments and per-target arguments. Global arguments -- Global compiler arguments are set with the following command. As an example you could do this. ```meson add_global_arguments('-DFOO=bar', language : 'c') ``` This makes Meson add the define to all C compilations. Usually you would use this setting for flags for global settings. Note that for setting the C/C++ language standard (the `-std=c99` argument in GCC), you would probably want to use a default option of the [[project]] function. For details see the [reference manual](Reference-manual.md). Global arguments have certain limitations. They all have to be defined before any build targets are specified. This ensures that the global flags are the same for every single source file built in the entire project with one exception. Compilation tests that are run as part of your project configuration do not use these flags. The reason for that is that you may need to run a test compile with and without a given flag to determine your build setup. For this reason tests do not use these global arguments. You should set only the most essential flags with this setting, you should *not* set debug or optimization flags. Instead they should be specified by selecting an appropriate build type. Project arguments -- Project arguments work similar to global arguments except that they are valid only within the current subproject. The usage is simple: ```meson add_project_arguments('-DMYPROJ=projname', language : 'c') ``` This would add the compiler flags to all C sources in the current project. Per target arguments -- Per target arguments are just as simple to define. ```meson executable('prog', 'prog.cc', cpp_args : '-DCPPTHING') ``` Here we create a C++ executable with an extra argument that is used during compilation but not for linking. You can find the parameter name for other languages in the [reference tables](Reference-tables.md). Specifying extra linker arguments is done in the same way: ```meson executable('prog', 'prog.cc', link_args : '-Wl,--linker-option') ``` ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Adding-new-projects-to-wrapdb.md0000644000175000017500000001432215064306076024317 0ustar00eschwartzeschwartz# Adding new projects to WrapDB ## How it works New wraps must be submitted as a working subproject to the [wrapdb repository](https://github.com/mesonbuild/wrapdb). There are two types of wraps on WrapDB - regular wraps and wraps with Meson build definition patches. Wraps with Meson build definition patches work in much the same way as Debian: we take the unaltered upstream source package and add a new build system to it as a patch. These build systems are stored as a subdirectory of subprojects/packagefiles/. They only contain build definition files. You may also think of them as an overlay to upstream source. Wraps without Meson build definition patches only contain the wrap metadata describing how to fetch the project Whenever a new release is pushed into the wrapdb, a new tag is generated with an incremented version number, and a new release is added to the wrapdb API listing. All the old releases remain unaltered. New commits are always done via GitHub merge requests and must be reviewed by someone other than the submitter. Note that your Git repo with wrap must not contain the subdirectory of the source release. That gets added automatically by the service. You also must not commit any source code from the original tarball into the wrap repository. ## Choosing the wrap name Wrapped subprojects are used much like external dependencies. Thus they should have the same name as the upstream projects. NOTE: Wrap names must fully match this regexp: `[a-z0-9._]+`. If the project provides a pkg-config file, then the wrap name should be the same as the pkg-config name. Usually this is the name of the project, such as `libpng`. Sometimes it is slightly different, however. As an example the libogg project's chosen pkg-config name is `ogg` instead of `libogg`, which is the reason why the wrap is named plain `ogg`. If there is no pkg-config file, the name the project uses/promotes should be used, lowercase only (Catch2 -> catch2). If the project name is too generic or ambiguous (e.g. `benchmark`), consider using `organization-project` naming format (e.g. `google-benchmark`). ## How to contribute a new wrap If the project already uses Meson build system, then only a wrap file `project.wrap` should be provided. In other case a Meson build definition patch - a set of `meson.build` files - should also be provided. ### Creating the wrap contents New release branches require a `project.wrap` file, so create one if needed. ``` ${EDITOR} upstream.wrap ``` The file format is simple, see any existing wrapdb subproject for the content. The checksum is SHA-256 and can be calculated with the following command on most unix-like operating systems: ``` sha256sum path/to/libfoo-1.0.0.tar.gz ``` Under macOS the command is the following: ``` shasum -a 256 path/to/libfoo-1.0.0.tar.gz ``` Next you need to add the entries that define what dependencies the current project provides. This is important, as it is what makes Meson's automatic dependency resolver work. It is done by adding a `provide` entry at the end of the `upstream.wrap` file. Using the Ogg library as an example, this is what it would look like: ```ini [provide] ogg = ogg_dep ``` The `ogg` part on the left refers to the dependency name, which should be the same as its Pkg-Config name. `ogg_dep` on the right refers to the variable in the build definitions that provides the dependency. Most commonly it holds the result of a `declare_dependency` call. If a variable of that name is not defined, Meson will exit with a hard error. For further details see [the main Wrap manual](Wrap-dependency-system-manual.md). Now you can create the build files, if the upstream project does not contain any, and work on them until the project builds correctly. Remember that all files go in the directory `subprojects/packagefiles/`. ``` ${EDITOR} meson.build meson.options ``` In order to apply the locally added build files to the upstream release tarball, the `wrap-file` section must contain a `patch_directory` property naming the subdirectory in subprojects/packagefiles/ with the build files inside, as this is central to the way the wrapdb works. It will be used by the wrapdb meson.build, and when a release is created, the files from this directory will be converted into an archive and a patch_url will be added to the wrap file. When you are satisfied with the results, add the build files to Git, update releases.json as described in [README.md](https://github.com/mesonbuild/wrapdb#readme), and push the result to GitHub. ``` git add releases.json subprojects/project.wrap subprojects/packagefiles/project/ git commit -a -m 'Add wrap files for libfoo-1.0.0' git push -u origin libfoo ``` Now you should create a pull request on GitHub. If packaging review requires you to do changes, use the `--amend` argument to `commit` so that your branch will have only one commit. ``` ${EDITOR} meson.build git commit -u --amend git push --force ``` ## Changes to original source The point of a wrap is to provide the upstream project with as few changes as possible. Most projects should not contain anything more than a few Meson definition files. Sometimes it may be necessary to add a template header file or something similar. These should be held at a minimum. It should especially be noted that there must **not** be any patches to functionality. All such changes must be submitted to upstream. You may also host your own Git repo with the changes if you wish. The Wrap system has native support for Git subprojects. ## Passing automatic validation Every submitted wrap goes through an automated correctness review and passing it is a requirement for merging. Therefore it is highly recommended that you run the validation checks yourself so you can fix any issues faster. You can test the wrap itself with the following commands: meson subprojects purge --confirm meson setup builddir/ -Dwraps= The first command is to ensure the wrap is correctly fetched from the latest packagefiles. The second command configures meson and selects a set of subprojects to enable. The GitHub project contains automatic CI on pushing to run the project and check the metadata for obvious mistakes. This can be checked from your fork before submitting a PR. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Additional.md0000644000175000017500000000026715064306076020671 0ustar00eschwartzeschwartz--- short-description: Misc documentation ... # Additional documentation This section references documents miscellaneous design, benchmarks, or basically anything concerning Meson. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Build-options.md0000644000175000017500000002212115064306076021342 0ustar00eschwartzeschwartz--- short-description: Build options to configure project properties ... # Build options Most non-trivial builds require user-settable options. As an example a program may have two different data backends that are selectable at build time. Meson provides for this by having an option definition file. Its name is `meson.options` and it is placed at the root of your source tree. For versions of meson before 1.1, this file was called `meson_options.txt`. Here is a simple option file. ```meson option('someoption', type : 'string', value : 'optval', description : 'An option') option('other_one', type : 'boolean', value : false) option('combo_opt', type : 'combo', choices : ['one', 'two', 'three'], value : 'three') option('integer_opt', type : 'integer', min : 0, max : 5, value : 3) # Since 0.45.0 option('free_array_opt', type : 'array', value : ['one', 'two']) # Since 0.44.0 option('array_opt', type : 'array', choices : ['one', 'two', 'three'], value : ['one', 'two']) option('some_feature', type : 'feature', value : 'enabled') # Since 0.47.0 option('long_desc', type : 'string', value : 'optval', description : 'An option with a very long description' + 'that does something in a specific context') # Since 0.55.0 ``` For built-in options, see [Built-in options][builtin_opts]. ## Build option types All types allow a `description` value to be set describing the option, if no description is set then the name of the option will be used instead. ### Strings The string type is a free form string. If the default value is not set then an empty string will be used as the default. ### Booleans Booleans may have values of either `true` or `false`. If no default value is supplied then `true` will be used as the default. ### Combos A combo allows any one of the values in the `choices` parameter to be selected. If no default value is set then the first value will be the default. ### Integers An integer option contains a single integer with optional upper and lower values that are specified with the `min` and `max` keyword arguments. This type is available since Meson version 0.45.0. ### Arrays Arrays represent an array of strings. By default the array can contain arbitrary strings. To limit the possible values that can be used set the `choices` parameter. Meson will then only allow the value array to contain strings that are in the given list. The array may be empty. The `value` parameter specifies the default value of the option and if it is unset then the values of `choices` will be used as the default. As of 0.47.0 -Dopt= and -Dopt=[] both pass an empty list, before this -Dopt= would pass a list with an empty string. This type is available since version 0.44.0 ### Features A `feature` option has three states: `enabled`, `disabled` or `auto`. It is intended to be passed as a value for the `required` keyword argument of most functions. Currently supported in [[add_languages]], [[compiler.find_library]], [[compiler.has_header]], [[dependency]], [[find_program]], [[import]] and [[subproject]] functions. - `enabled` is the same as passing `required : true`. - `auto` is the same as passing `required : false`. - `disabled` do not look for the dependency and always return 'not-found'. When getting the value of this type of option using [[get_option]], a special [[@feature]] object is returned instead of the string representation of the option's value. This object can be passed to `required`: ```meson d = dependency('foo', required : get_option('myfeature')) if d.found() app = executable('myapp', 'main.c', dependencies : [d]) endif ``` To check the value of the feature, the object has three methods returning a boolean and taking no argument: - `.enabled()` - `.disabled()` - `.auto()` This is useful for custom code depending on the feature: ```meson if get_option('myfeature').enabled() # ... endif ``` If the value of a `feature` option is set to `auto`, that value is overridden by the global `auto_features` option (which defaults to `auto`). This is intended to be used by packagers who want to have full control on which dependencies are required and which are disabled, and not rely on build-deps being installed (at the right version) to get a feature enabled. They could set `auto_features=enabled` to enable all features and disable explicitly only the few they don't want, if any. This type is available since version 0.47.0 ## Deprecated options Since *0.60.0* Project options can be marked as deprecated and Meson will warn when user sets a value to it. It is also possible to deprecate only some of the choices, and map deprecated values to a new value. ```meson # Option fully deprecated, it warns when any value is set. option('o1', type: 'boolean', deprecated: true) # One of the choices is deprecated, it warns only when 'a' is in the list of values. option('o2', type: 'array', choices: ['a', 'b'], deprecated: ['a']) # One of the choices is deprecated, it warns only when 'a' is in the list of values # and replace it by 'c'. option('o3', type: 'array', choices: ['a', 'b', 'c'], deprecated: {'a': 'c'}) # A boolean option has been replaced by a feature, old true/false values are remapped. option('o4', type: 'feature', deprecated: {'true': 'enabled', 'false': 'disabled'}) # A feature option has been replaced by a boolean, enabled/disabled/auto values are remapped. option('o5', type: 'boolean', deprecated: {'enabled': 'true', 'disabled': 'false', 'auto': 'false'}) ``` Since *0.63.0* the `deprecated` keyword argument can take the name of a new option that replaces this option. In that case, setting a value on the deprecated option will set the value on both the old and new names, assuming they accept the same values. ```meson # A boolean option has been replaced by a feature with another name, old true/false values # are accepted by the new option for backward compatibility. option('o6', type: 'boolean', value: 'true', deprecated: 'o7') option('o7', type: 'feature', value: 'enabled', deprecated: {'true': 'enabled', 'false': 'disabled'}) # A project option is replaced by a module option option('o8', type: 'string', value: '', deprecated: 'python.platlibdir') ``` ## Using build options ```meson optval = get_option('opt_name') ``` This function also allows you to query the value of Meson's built-in project options. For example, to get the installation prefix you would issue the following command: ```meson prefix = get_option('prefix') ``` It should be noted that you cannot set option values in your Meson scripts. They have to be set externally with the `meson configure` command line tool. Running `meson configure` without arguments in a build dir shows you all options you can set. To change their values use the `-D` option: ```console $ meson configure -Doption=newvalue ``` Setting the value of arrays is a bit special. If you only pass a single string, then it is considered to have all values separated by commas. Thus invoking the following command: ```console $ meson configure -Darray_opt=foo,bar ``` would set the value to an array of two elements, `foo` and `bar`. If you need to have commas in your string values, then you need to pass the value with proper shell quoting like this: ```console $ meson configure "-Doption=['a,b', 'c,d']" ``` The inner values must always be single quotes and the outer ones double quotes. To change values in subprojects prepend the name of the subproject and a colon: ```console $ meson configure -Dsubproject:option=newvalue ``` **NOTE:** If you cannot call `meson configure` you likely have an old version of Meson. In that case you can call `mesonconf` instead, but that is deprecated in newer versions ## Yielding to superproject option Suppose you have a master project and a subproject. In some cases it might be useful to have an option that has the same value in both of them. This can be achieved with the `yield` keyword. Suppose you have an option definition like this: ```meson option('some_option', type : 'string', value : 'value', yield : true) ``` If you build this project on its own, this option behaves like usual. However if you build this project as a subproject of another project which also has an option called `some_option`, then calling `get_option` returns the value of the superproject. If the value of `yield` is `false`, `get_option` returns the value of the subproject's option. *Since 1.8.0* `-Dsub:some_option=anothervalue`, when used with a yielding option, sets the value separately from the option it yields to. ## Built-in build options There are a number of [built-in options][builtin_opts]. To get the current list execute `meson configure` in the build directory. [builtin_opts]: https://mesonbuild.com/Builtin-options.html ### Visual Studio #### Startup project The `backend_startup_project` option can be set to define the default project that will be executed with the "Start debugging F5" action in visual studio. It should be the same name as an executable target name. ```meson project('my_project', 'c', default_options: ['backend_startup_project=my_exe']) executable('my_exe', ...) ``` ### Ninja #### Max links The `backend_max_links` can be set to limit the number of processes that ninja will use to link. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Build-system-converters.md0000644000175000017500000000220115064306076023360 0ustar00eschwartzeschwartz--- short-description: Converting other build systems to Meson ... # Build system converters Moving from one build system into another includes a fair bit of work. To make things easier, Meson provides scripts to convert other build systems into Meson. At the time of writing, scripts for CMake and autotools exist. It can be found in the `tools` subdirectory in Meson's source tree. The scripts do not try to do a perfect conversion. This would be extremely difficult because the data models of other build systems are very different. The goal of the converter script is to convert as much of the low level drudgery as possible. Using the scripts is straightforward. We'll use the CMake one as an example but the Autotools one works exactly the same way. cmake2meson.py path/to/CMake/project/root This command generates a skeleton Meson project definition that tries to mirror CMake's setup as close as possible. Once this is done, you need to go through these files manually and finalize the conversion. To make this task as simple as possible, the converter script will transfer all comments from the CMake definition into Meson definition. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Build-targets.md0000644000175000017500000000677315064306076021337 0ustar00eschwartzeschwartz--- short-description: Definition of build targets ... # Build targets Meson provides four kinds of build targets: executables, libraries (which can be set to be built as static or shared or both of them at the build configuration time), static libraries, and shared libraries. They are created with the commands `executable`, `library`, `static_library` and `shared_library`, respectively. All objects created in this way are **immutable**. That is, you cannot change any aspect of them after they have been constructed. This ensures that all information pertaining to a given build target is specified in one well defined place. Libraries and executables -- As an example, here is how you would build a library. ```meson project('shared lib', 'c') library('mylib', 'source.c') ``` It is generally preferred to use the `library` command instead of `shared_library` and `static_library` and then configure which libraries (static or shared or both of them) will be built at the build configuration time using the `default_library` [built-in option](Builtin-options.md). In Unix-like operating systems, shared libraries can be versioned. Meson supports this with keyword arguments, which will be ignored if the library is configured as static at the compile time. ```meson project('shared lib', 'c') library('mylib', 'source.c', version : '1.2.3', soversion : '1') ``` It is common to build a library and then an executable that links against it. This is supported as well. ```meson project('shared lib', 'c') lib = library('mylib', 'source.c') executable('program', 'prog.c', link_with : lib) ``` Meson sets things up so that the resulting executable can be run directly from the build directory. There is no need to write shell scripts or set environment variables. One target can have multiple language source files. ```meson project('multilang', 'c', 'cpp') executable('multiexe', 'file.c', 'file2.cc') ``` Object files -- Sometimes you can't build files from sources but need to utilize an existing object file. A typical case is using an object file provided by a third party. Object files can be specified just like sources. ```meson exe = executable('myexe', 'source.cpp', objects : 'third_party_object.o') ``` A different case is when you want to use object files built in one target directly in another. A typical case is when you build a shared library and it has an internal class that is not exported in the ABI. This means you can't access it even if you link against the library. Typical workarounds for this include building both a shared and static version of the library or putting the source file in the test executable's source list. Both of these approaches cause the source to be built twice, which is slow. In Meson you can extract object files from targets and use them as-is on other targets. This is the syntax for it. ```meson lib = shared_library('somelib', 'internalclass.cc', 'file.cc', ...) eo = lib.extract_objects('internalclass.cc') executable('classtest', 'classtest.cpp', objects : eo) ``` Here we take the internal class object and use it directly in the test. The source file is only compiled once. Note that careless use of this feature may cause strange bugs. As an example trying to use objects of an executable or static library in a shared library will not work because shared library objects require special compiler flags. Getting this right is the user's responsibility. For this reason it is strongly recommended that you only use this feature for generating unit test executables in the manner described above. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1758563390.0 meson-1.9.1/docs/markdown/Builtin-options.md0000644000175000017500000007265615064306076021733 0ustar00eschwartzeschwartz--- short-description: Built-in options to configure project properties ... # Built-in options Meson provides two kinds of options: [build options provided by the build files](Build-options.md) and built-in options that are either universal options, base options, compiler options. ## Universal options All these can be set by passing `-Doption=value` to `meson` (aka `meson setup`), or by setting them inside `default_options` of [[project]] in your `meson.build`. Some options can also be set by `--option=value`, or `--option value` -- a list is shown by running `meson setup --help`. For legacy reasons `--warnlevel` is the cli argument for the `warning_level` option. They can also be edited after setup using `meson configure -Doption=value`. Installation options are usually relative to the prefix but it should not be relied on, since they can be absolute paths in the following cases: * When the prefix is `/usr`: `sysconfdir` defaults to `/etc`, `localstatedir` defaults to `/var`, and `sharedstatedir` defaults to `/var/lib` * When the prefix is `/usr/local`: `localstatedir` defaults to `/var/local`, and `sharedstatedir` defaults to `/var/local/lib` * When an absolute path outside of prefix is provided by the user/distributor. ### Directories | Option | Default value | Description | | ------ | ------------- | ----------- | | prefix | see below | Installation prefix | | bindir | bin | Executable directory | | datadir | share | Data file directory | | includedir | include | Header file directory | | infodir | share/info | Info page directory | | libdir | see below | Library directory | | licensedir | see below | Licenses directory (since 1.1.0)| | libexecdir | libexec | Library executable directory | | localedir | share/locale | Locale data directory | | localstatedir | var | Localstate data directory | | mandir | share/man | Manual page directory | | sbindir | sbin | System executable directory | | sharedstatedir | com | Architecture-independent data directory | | sysconfdir | etc | Sysconf data directory | `prefix` defaults to `C:/` on Windows, and `/usr/local` otherwise. You should always override this value. `libdir` is automatically detected based on your platform, it should be correct when doing "native" (build machine == host machine) compilation. For cross compiles Meson will try to guess the correct libdir, but it may not be accurate, especially on Linux where different distributions have different defaults. Using a [cross file](Cross-compilation.md#defining-the-environment), particularly the paths section may be necessary. `licensedir` is empty by default. If set, it defines the default location to install a dependency manifest and project licenses. For more details, see [[meson.install_dependency_manifest]]. ### Core options Options that are labeled "per machine" in the table are set per machine. See the [specifying options per machine](#specifying-options-per-machine) section for details. | Option | Default value | Description | Is per machine | Per subproject (since) | | -------------------------------------- | ------------- | ----------- | -------------- | ---------------------- | | auto_features {enabled, disabled, auto} | auto | Override value of all 'auto' features | no | no | | backend {ninja, vs,
vs2010, vs2012, vs2013, vs2015, vs2017, vs2019, vs2022, xcode, none} | ninja | Backend to use | no | no | | genvslite {vs2022} | vs2022 | Setup multi-buildtype ninja build directories and Visual Studio solution | no | no | | buildtype {plain, debug,
debugoptimized, release, minsize, custom} | debug | Build type to use | no | 1.8.0 | | debug | true | Enable debug symbols and other information | no | 1.8.0 | | default_both_libraries {shared, static, auto} | shared | Default library type for both_libraries | no | 1.8.0 | | default_library {shared, static, both} | shared | Default library type | no | 0.54.0 | | errorlogs | true | Whether to print the logs from failing tests. | no | no | | install_umask {preserve, 0000-0777} | 022 | Default umask to apply on permissions of installed files | no | no | | layout {mirror,flat} | mirror | Build directory layout | no | no | | optimization {plain, 0, g, 1, 2, 3, s} | 0 | Optimization level | no | 1.8.0 | | pkg_config_path {OS separated path} | '' | Additional paths for pkg-config to search before builtin paths | yes | no | | prefer_static | false | Whether to try static linking before shared linking | no | no | | cmake_prefix_path | [] | Additional prefixes for cmake to search before builtin paths | yes | no | | stdsplit | true | Split stdout and stderr in test logs | no | no | | strip | false | Strip targets on install | no | 1.8.0 | | unity {on, off, subprojects} | off | Unity build | no | 1.8.0 | | unity_size {>=2} | 4 | Unity file block size | no | 1.8.0 | | warning_level {0, 1, 2, 3, everything} | 1 | Set the warning level. From 0 = compiler default to everything = highest | no | 0.56.0 | | werror | false | Treat warnings as errors | no | 0.54.0 | | wrap_mode {default, nofallback,
nodownload, forcefallback, nopromote} | default | Wrap mode to use | no | no | | force_fallback_for | [] | Force fallback for those dependencies | no | no | | vsenv | false | Activate Visual Studio environment | no | no | (For the Rust language only, `warning_level=0` disables all warnings). #### Details for `backend` Several build file formats are supported as command runners to build the configured project. Meson prefers ninja by default, but platform-specific backends are also available for better IDE integration with native tooling: Visual Studio for Windows, and xcode for macOS. It is also possible to configure with no backend at all, which is an error if you have targets to build, but for projects that need configuration + testing + installation allows for a lighter automated build pipeline. #### Details for `genvslite` Setup multiple buildtype-suffixed, ninja-backend build directories (e.g. [builddir]_[debug/release/etc.]) and generate [builddir]_vs containing a Visual Studio solution with multiple configurations that invoke a meson compile of the setup build directories, as appropriate for the current configuration (buildtype). This has the effect of a simple setup macro of multiple 'meson setup ...' invocations with a set of different buildtype values. E.g. `meson setup ... --genvslite vs2022 somebuilddir` does the following - ``` meson setup ... --backend ninja --buildtype debug somebuilddir_debug meson setup ... --backend ninja --buildtype debugoptimized somebuilddir_debugoptimized meson setup ... --backend ninja --buildtype release somebuilddir_release ``` and additionally creates another 'somebuilddir_vs' directory that contains a generated multi-configuration visual studio solution and project(s) that are set to build/compile with the somebuilddir_[...] that's appropriate for the solution's selected buildtype configuration. #### Details for `buildtype` For setting optimization levels and toggling debug, you can either set the `buildtype` option, or you can set the `optimization` and `debug` options which give finer control over the same. Whichever you decide to use, the other will be deduced from it. For example, `-Dbuildtype=debugoptimized` is the same as `-Ddebug=true -Doptimization=2` and vice-versa. This table documents the two-way mapping: | buildtype | debug | optimization | | --------- | ----- | ------------ | | plain | false | plain | | debug | true | 0 | | debugoptimized | true | 2 | | release | false | 3 | | minsize | true | s | All other combinations of `debug` and `optimization` set `buildtype` to `'custom'`. Note that `-Ddebug=false` does not cause the compiler preprocessor macro `NDEBUG` to be defined. The macro can be defined using the base option `b_ndebug`, described below. #### Details for `warning_level` Exact flags per warning level is compiler specific, but there is an approximate table for most common compilers. | Warning level | GCC/Clang | MSVC | | ------------- | --- | ---- | | 0 | | | | 1 | -Wall | /W2 | | 2 | -Wall -Wextra | /W3 | | 3 | -Wall -Wextra -Wpedantic | /W4 | | everything | -Weverything | /Wall | Clang's `-Weverything` is emulated on GCC by passing all known warning flags. #### Details for `vsenv` The `--vsenv` argument is supported since `0.60.0`, `-Dvsenv=true` syntax is supported since `1.1.0`. Since `0.59.0`, meson automatically activates a Visual Studio environment on Windows for all its subcommands, but only if no other compilers (e.g. `gcc` or `clang`) are found, and silently continues if Visual Studio activation fails. Setting the `vsenv` option to `true` forces Visual Studio activation even when other compilers are found. It also make Meson abort with an error message when activation fails. `vsenv` is `true` by default when using the `vs` backend. #### Details for `default_both_libraries` Since `1.6.0`, you can specify the default type of library selected when using a `both_libraries` object with `default_both_libraries`. Note that, unlike `default_library`, this option does not affect how the library artifacts are built, but how they are internally linked to the dependent targets within the same project. The possible values of this option are 'shared' (default value, compatible with previous meson versions), 'static', and 'auto'. With auto, the value from the `default_library` option is used, unless it is 'both', in which case 'shared' is used instead. When `default_both_libraries` is 'auto', passing a [[@both_libs]] dependency in [[both_libraries]] will link the static dependency with the static lib, and the shared dependency with the shared lib. ## Base options These are set in the same way as universal options, either by `-Doption=value`, or by setting them inside `default_options` of [[project]] in your `meson.build`. However, they cannot be shown in the output of `meson setup --help` because they depend on both the current platform and the compiler that will be selected. The only way to see them is to setup a builddir and then run `meson configure` on it with no options. The following options are available. Note that they may not be available on all platforms or with all compilers: | Option | Default value | Possible values | Description | |---------------------|----------------------|---------------------------------------------------------------|--------------------------------------------------------------------------------| | b_asneeded | true | true, false | Use -Wl,--as-needed when linking | | b_bitcode | false | true, false | Embed Apple bitcode, see below | | b_colorout | always | auto, always, never | Use colored output | | b_coverage | false | true, false | Enable coverage tracking | | b_lundef | true | true, false | Don't allow undefined symbols when linking | | b_lto | false | true, false | Use link time optimization | | b_lto_threads | 0 | Any integer* | Use multiple threads for lto. *(Added in 0.57.0)* | | b_lto_mode | default | default, thin | Select between lto modes, thin and default. *(Added in 0.57.0)* | | b_thinlto_cache | false | true, false | Enable LLVM's ThinLTO cache for faster incremental builds. *(Added in 0.64.0)* | | b_thinlto_cache_dir | (Internal build dir) | true, false | Specify where to store ThinLTO cache objects. *(Added in 0.64.0)* | | b_ndebug | false | true, false, if-release | Disable asserts | | b_pch | true | true, false | Use precompiled headers | | b_pgo | off | off, generate, use | Use profile guided optimization | | b_sanitize | none | see below | Code sanitizer to use | | b_staticpic | true | true, false | Build static libraries as position independent | | b_pie | false | true, false | Build position-independent executables (since 0.49.0) | | b_vscrt | from_buildtype | none, md, mdd, mt, mtd, from_buildtype, static_from_buildtype | VS runtime library to use (since 0.48.0) (static_from_buildtype since 0.56.0) | The default and possible values of sanitizers changed in 1.8. Before 1.8 they were string values, and restricted to a specific subset of values: `none`, `address`, `thread`, `undefined`, `memory`, `leak`, or `address,undefined`. In 1.8 it was changed to a free form array of sanitizers, which are checked by a compiler and linker check. For backwards compatibility reasons `get_option('b_sanitize')` continues to return a string with the array values separated by a comma. Furthermore: - If the `b_sanitize` option is empty, the `'none'` string is returned. - If it contains only the values `'address'` and `'undefined'`, they are always returned as the `'address,undefined'` string, in this order. - Otherwise, the array elements are returned in undefined order. \* < 0 means disable, == 0 means automatic selection, > 0 sets a specific number to use LLVM supports `thin` lto, for more discussion see [LLVM's documentation](https://clang.llvm.org/docs/ThinLTO.html) The default value of `b_vscrt` is `from_buildtype`. The following table is used internally to pick the CRT compiler arguments for `from_buildtype` or `static_from_buildtype` *(since 0.56)* based on the value of the `buildtype` option: | buildtype | from_buildtype | static_from_buildtype | | -------- | -------------- | --------------------- | | debug | `/MDd` | `/MTd` | | debugoptimized | `/MD` | `/MT` | | release | `/MD` | `/MT` | | minsize | `/MD` | `/MT` | | custom | error! | error! | ### Notes about Apple Bitcode support `b_bitcode` will pass `-fembed-bitcode` while compiling and will pass `-Wl,-bitcode_bundle` while linking. These options are incompatible with `b_asneeded`, so that option will be silently disabled. [[shared_module]]s will not have bitcode embedded because `-Wl,-bitcode_bundle` is incompatible with `-Wl,-undefined,dynamic_lookup` which is necessary for shared modules to work. ## Compiler options Same caveats as base options above. The following options are available. They can be set by passing `-Doption=value` to `meson`. Note that both the options themselves and the possible values they can take will depend on the target platform or compiler being used: | Option | Default value | Possible values | Description | | ------ | ------------- | --------------- | ----------- | | c_args | | free-form comma-separated list | C compile arguments to use | | c_link_args | | free-form comma-separated list | C link arguments to use | | c_std | none | none, c89, c99, c11, c17, c18, c2x, c23, c2y, gnu89, gnu99, gnu11, gnu17, gnu18, gnu2x, gnu23, gnu2y | C language standard to use | | c_winlibs | see below | free-form comma-separated list | Standard Windows libs to link against | | c_thread_count | 4 | integer value ≥ 0 | Number of threads to use with emcc when using threads | | cpp_args | | free-form comma-separated list | C++ compile arguments to use | | cpp_link_args | | free-form comma-separated list | C++ link arguments to use | | cpp_std | none | none, c++98, c++03, c++11, c++14, c++17, c++20
c++2a, c++1z, gnu++03, gnu++11, gnu++14, gnu++17, gnu++1z,
gnu++2a, gnu++20, vc++14, vc++17, vc++20, vc++latest | C++ language standard to use | | cpp_debugstl | false | true, false | C++ STL debug mode | | cpp_eh | default | none, default, a, s, sc | C++ exception handling type | | cpp_rtti | true | true, false | Whether to enable RTTI (runtime type identification) | | cpp_thread_count | 4 | integer value ≥ 0 | Number of threads to use with emcc when using threads | | cpp_winlibs | see below | free-form comma-separated list | Standard Windows libs to link against | | fortran_std | none | [none, legacy, f95, f2003, f2008, f2018] | Fortran language standard to use | | rust_dynamic_std | false | true, false | Whether to link dynamically to the Rust standard library *(Added in 1.9.0)* | | cuda_ccbindir | | filesystem path | CUDA non-default toolchain directory to use (-ccbin) *(Added in 0.57.1)* | The default values of `c_winlibs` and `cpp_winlibs` are in compiler-specific argument forms, but the libraries are: kernel32, user32, gdi32, winspool, shell32, ole32, oleaut32, uuid, comdlg32, advapi32. All these `_*` options are specified per machine. See below in the [specifying options per machine](#specifying-options-per-machine) section on how to do this in cross builds. When using MSVC, `cpp_eh=[value]` will result in `/EH[value]` being passed. The magic value `none` translates to `s-c-` to disable exceptions. *Since 0.51.0* `default` translates to `sc`. When using gcc-style compilers, nothing is passed (allowing exceptions to work), while `cpp_eh=none` passes `-fno-exceptions`. Since *0.54.0* The `_thread_count` option can be used to control the value passed to `-s PTHREAD_POOL_SIZE` when using emcc. No other c/c++ compiler supports this option. Since *0.63.0* all compiler options can be set per subproject, see [here](#specifying-options-per-subproject) for details on how the default value is inherited from the main project. This is useful, for example, when the main project requires C++11, but a subproject requires C++14. The `cpp_std` value from the subproject's `default_options` is now respected. Since *1.3.0* `c_std` and `cpp_std` options now accept a list of values. Projects that prefer GNU C, but can fallback to ISO C, can now set, for example, `default_options: 'c_std=gnu11,c11'`, and it will use `gnu11` when available, but fallback to c11 otherwise. It is an error only if none of the values are supported by the current compiler. Likewise, a project that can take benefit of `c++17` but can still build with `c++11` can set `default_options: 'cpp_std=c++17,c++11'`. This allows us to deprecate `gnuXX` values from the MSVC compiler. That means that `default_options: 'c_std=gnu11'` will now print a warning with MSVC but fallback to `c11`. No warning is printed if at least one of the values is valid, i.e. `default_options: 'c_std=gnu11,c11'`. In the future that deprecation warning will become an hard error because `c_std=gnu11` should mean GNU is required, for projects that cannot be built with MSVC for example. ## Specifying options per machine Since *0.51.0*, some options are specified per machine rather than globally for all machine configurations. Prefixing the option with `build.` only affects the build machine configuration, while leaving it unprefixed only affects the host machine configuration. For example: - `build.pkg_config_path` controls the paths pkg-config will search for `native: true` (build machine) dependencies. - `pkg_config_path` controls the paths pkg-config will search for `native: false` (host machine) dependencies. This is useful for cross builds. In native builds, the build and host machines are the same, and the unprefixed option alone will suffice. Prior to *0.51.0*, these options only affected native builds when specified on the command line as there was no `build.` prefix. Similarly named fields in the `[properties]` section of the cross file would affect cross compilers, but the code paths were fairly different, allowing differences in behavior to crop out. ## Specifying options per subproject Several built-in options and all compiler options can be defined per subproject. This is useful, for example, when building shared libraries in the main project and statically linking a subproject, or when the main project must build with no warnings but some subprojects cannot. Most of the time, this would be used either in the parent project by setting subproject's default_options (e.g. `subproject('foo', default_options: 'default_library=static')`), or by the user through the command line: `-Dfoo:default_library=static`. The value is overridden in this order: - `opt=value` from parent project's `default_options` - `opt=value` from subproject's `default_options` - `opt=value` from machine file - `opt=value` from command line - `subp:opt=value` from parent project's default options - `opt=value` from `subproject()` `default_options` - `subp:opt=value` from machine file - `subp:opt=value` from command line ### Old behavior Between *0.54.0* and *1.7.x* only a few options could be defined per subproject: * `default_library` and `werror` since *0.54.0*; * `warning_level` since *0.56.0*; * compiler options since *0.63.0* The value was overridden in this order: - `opt=value` from parent project's `default_options` - `opt=value` from machine file - `opt=value` from command line - `opt=value` from subproject's `default_options` - `subp:opt=value` from parent project's default options - `opt=value` from `subproject()` `default_options` - `subp:opt=value` from machine file - `subp:opt=value` from command line In other word, the subproject's `default_options` had a *higher* priority than `opt=value` from machine file or command line. ## Module options Some Meson modules have built-in options. They can be set by prefixing the option with the module's name: `-D.