liba 0.1.15

An algorithm library based on C/C++
Documentation
name: meson
on:
  workflow_dispatch:
jobs:
  MSVC:
    strategy:
      fail-fast: false
      matrix:
        include: [
          { backend: vs },
          { backend: ninja },
        ]
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
          submodules: true
      - uses: actions/checkout@v4
        with:
          repository: tqfx/lua
          path: _/lua
      - name: Run setup
        run: |
          python -m venv _
          _/Scripts/Activate.ps1
          python -m pip install -U meson ninja
          python -m pip install -r requirements.txt
          cmake -S _/lua -B _/lua -DCMAKE_INSTALL_PREFIX=_ -DCMAKE_BUILD_TYPE=Release `
            ${{ matrix.backend == 'vs' && '-A x64' || '-G "Unix Makefiles"' }}
          cmake --build _/lua --target install
          Get-ChildItem Env: | Sort Name
      - name: Run meson
        run: |
          _/Scripts/Activate.ps1
          Set-PSDebug -Trace 1
          meson setup build --buildtype release `
            --cmake-prefix-path ${{ github.workspace }}/_ `
            --prefix ${{ github.workspace }}/_ `
            --backend ${{ matrix.backend }} `
            -Djava=${{ matrix.backend != 'vs' && '"$ENV:JAVA_HOME"' || '""' }} `
            -Dlua=lua `
            -Dpython=${{ matrix.backend != 'vs' }}
          meson install -C build
          meson test -C build
  MacOS:
    strategy:
      fail-fast: false
      matrix:
        include: [
          { cc: clang, cxx: clang++ },
        ]
    runs-on: macos-latest
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
          submodules: true
      - uses: actions/checkout@v4
        with:
          repository: tqfx/lua
          path: _/lua
      - uses: actions/checkout@v4
        with:
          repository: tqfx/quickjs
          path: _/quickjs
      - name: Run setup
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
        run: |
          python3 -m venv _
          . _/bin/activate
          python3 -m pip install -U meson ninja
          python3 -m pip install -r requirements.txt
          cmake -S _/lua -B _/lua -DCMAKE_INSTALL_PREFIX=_ -DCMAKE_BUILD_TYPE=Release
          cmake --build _/lua --target install
          env
      - uses: actions/cache@v4
        id: cache-quickjs
        with:
          path: |
            _/bin/qjs
            _/bin/qjsc
            _/lib/quickjs/libquickjs.a
            _/lib/quickjs/libquickjs.lto.a
            _/include/quickjs/quickjs.h
            _/include/quickjs/quickjs-libc.h
          key: quickjs-macos
      - if: steps.cache-quickjs.outputs.cache-hit != 'true'
        run: |
          cmake -S _/quickjs -B _/quickjs -DCMAKE_INSTALL_PREFIX=_ -DCMAKE_BUILD_TYPE=Release
          cmake --build _/quickjs --target install
      - name: Run meson
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
          PKG_CONFIG_PATH: ${{ github.workspace }}/_/lib/pkgconfig
        run: |
          . _/bin/activate
          set -x
          meson setup build \
            --cmake-prefix-path ${{ github.workspace }}/_ \
            --prefix ${{ github.workspace }}/_ \
            -Djava=$JAVA_HOME \
            -Dlua=lua5.4 \
            -Dpython=true \
            -Dquickjs=../_ \
            -Drust=true
          meson install -C build
          meson test -C build
  Linux:
    strategy:
      fail-fast: false
      matrix:
        include: [
          { cc: gcc, cxx: g++ },
          { cc: clang, cxx: clang++ },
        ]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          lfs: true
          submodules: true
      - uses: actions/checkout@v4
        with:
          repository: tqfx/lua
          path: _/lua
      - uses: actions/checkout@v4
        with:
          repository: tqfx/quickjs
          path: _/quickjs
      - name: Run setup
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
        run: |
          python3 -m venv _
          . _/bin/activate
          python3 -m pip install -U meson ninja
          python3 -m pip install -r requirements.txt
          cmake -S _/lua -B _/lua -DCMAKE_INSTALL_PREFIX=_ -DCMAKE_BUILD_TYPE=Release
          cmake --build _/lua --target install
          env
      - uses: actions/cache@v4
        id: cache-quickjs
        with:
          path: |
            _/bin/qjs
            _/bin/qjsc
            _/lib/quickjs/libquickjs.a
            _/lib/quickjs/libquickjs.lto.a
            _/include/quickjs/quickjs.h
            _/include/quickjs/quickjs-libc.h
          key: quickjs-linux
      - if: steps.cache-quickjs.outputs.cache-hit != 'true'
        run: |
          cmake -S _/quickjs -B _/quickjs -DCMAKE_INSTALL_PREFIX=_ -DCMAKE_BUILD_TYPE=Release
          cmake --build _/quickjs --target install
      - name: Run meson
        env:
          CC: ${{ matrix.cc }}
          CXX: ${{ matrix.cxx }}
          PKG_CONFIG_PATH: ${{ github.workspace }}/_/lib/pkgconfig
        run: |
          . _/bin/activate
          set -x
          meson setup build \
            --cmake-prefix-path ${{ github.workspace }}/_ \
            --prefix ${{ github.workspace }}/_ \
            -Djava=$JAVA_HOME \
            -Dlua=lua5.4 \
            -Dpython=true \
            -Dquickjs=../_ \
            -Drust=true
          meson install -C build
          meson test -C build