-
Notifications
You must be signed in to change notification settings - Fork 108
Add meson build system #471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
moi15moi
wants to merge
10
commits into
FFMS:master
Choose a base branch
from
moi15moi:Add-meson
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
073a450
Add meson support
moi15moi 477894c
When publishing a new release, build the project and add it to the re…
moi15moi 305be5e
[ci-meson] Add Cygwin
moi15moi 5206c48
[meson.build] Try to use gnu++11 first and fallback to c++11 if not a…
moi15moi 083247d
[AviSynth+.wrap] Add small meson.build to replace cmake
moi15moi 7f0f80d
Remove autotools and MSBuild support
moi15moi 69f6113
Add a test to verify that the header are indeed c99
moi15moi fef4ebf
Fix prototype error with header on clang
moi15moi 841b72c
[CI] Use UCRT64 instead of MINGW64
moi15moi 7793fe0
[ci-meson] Add msys2 CLANG64
moi15moi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| name: Meson Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| build-meson: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-latest | ||
| cc: gcc | ||
| cxx: g++ | ||
| - os: ubuntu-latest | ||
| cc: clang | ||
| cxx: clang++ | ||
| - os: macos-latest | ||
| cc: clang | ||
| cxx: clang++ | ||
| - os: windows-latest | ||
| cc: gcc | ||
| cxx: g++ | ||
| windows_env: msys2 | ||
| - os: windows-latest | ||
| cc: gcc | ||
| cxx: g++ | ||
| windows_env: cygwin | ||
|
|
||
| name: "Test (${{ matrix.os }}, ${{ matrix.cc }}${{ matrix.windows_env && format(', {0}', matrix.windows_env) || '' }})" | ||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| CC: ${{ matrix.cc }} | ||
| CXX: ${{ matrix.cxx }} | ||
| defaults: | ||
| run: | ||
| shell: ${{ matrix.windows_env == 'cygwin' && 'bash -o igncr ''{0}''' || (matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash') }} | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install deps (ubuntu) | ||
| if: matrix.os == 'ubuntu-latest' | ||
| run: | | ||
| sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7 -y | ||
| sudo apt-get update | ||
| sudo apt-get install autoconf automake wget ffmpeg libavformat-dev libavcodec-dev libswscale-dev libavutil-dev libswresample-dev meson | ||
|
|
||
| - name: Install deps (macOS) | ||
| if: matrix.os == 'macos-latest' | ||
| run: | | ||
| brew update | ||
| brew install autoconf automake libtool wget ffmpeg meson | ||
|
|
||
| - name: Setup MSYS2 (MINGW64) | ||
| if: matrix.windows_env == 'msys2' | ||
| uses: msys2/setup-msys2@v2 | ||
| with: | ||
| msystem: MINGW64 | ||
| install: >- | ||
| mingw-w64-x86_64-ca-certificates | ||
| mingw-w64-x86_64-ffmpeg | ||
| mingw-w64-x86_64-meson | ||
| mingw-w64-x86_64-toolchain | ||
|
|
||
| - name: Setup Cygwin | ||
| if: matrix.windows_env == 'cygwin' | ||
| uses: cygwin/cygwin-install-action@v6 | ||
| with: | ||
| packages: | | ||
| git | ||
| meson | ||
| pkg-config | ||
| gcc-g++ | ||
| make | ||
| ninja | ||
| zlib-devel | ||
| nasm | ||
|
|
||
| # We need to build ffmpeg on Cygwin since the packaged version doesn't include an HEVC decoder | ||
| - name: Clone ffmpeg (Cygwin) | ||
| if: matrix.windows_env == 'cygwin' | ||
| run: git clone https://git.ffmpeg.org/ffmpeg.git --depth 1 | ||
|
|
||
| - name: Configure ffmpeg (Cygwin) | ||
| if: matrix.windows_env == 'cygwin' | ||
| working-directory: ffmpeg | ||
| run: ./configure --disable-programs --disable-doc --disable-avdevice --disable-avfilter --disable-encoders --disable-muxers --disable-debug --disable-hwaccels --disable-network --disable-autodetect | ||
|
|
||
| - name: Build ffmpeg (Cygwin) | ||
| if: matrix.windows_env == 'cygwin' | ||
| working-directory: ffmpeg | ||
| run: make | ||
|
|
||
| - name: Install ffmpeg (Cygwin) | ||
| if: matrix.windows_env == 'cygwin' | ||
| working-directory: ffmpeg | ||
| run: make install | ||
|
|
||
| - name: Configure with Meson | ||
| run: | | ||
| if [ "${{ matrix.windows_env }}" = "cygwin" ]; then | ||
| meson setup builddir -Dtest=enabled --pkg-config-path="/usr/local/lib/pkgconfig" | ||
| else | ||
| meson setup builddir -Dtest=enabled | ||
| fi | ||
|
|
||
| - name: Build | ||
| run: meson compile -C builddir --verbose | ||
|
|
||
| - name: Run tests | ||
| run: meson test -C builddir --verbose | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| name: On Release | ||
|
|
||
| on: | ||
| release: | ||
| types: [published] | ||
|
|
||
| jobs: | ||
| call-build-win: | ||
| uses: ./.github/workflows/ci-windows.yml | ||
|
|
||
| release-win: | ||
| name: Release Windows artifacts | ||
| runs-on: windows-latest | ||
| needs: call-build-win | ||
| permissions: | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Download wheel artifact | ||
| uses: actions/download-artifact@v7 | ||
|
|
||
| - name: Set RELEASE_TAG environment variable | ||
| run: | | ||
| $release_tag = "ffms2-${{ github.event.release.tag_name }}-msvc" | ||
| echo "RELEASE_TAG=$release_tag" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
|
||
| - name: Create package | ||
| run: | | ||
| mkdir $env:RELEASE_TAG | ||
| cd $env:RELEASE_TAG | ||
| Copy-Item -Path "..\ffms2_windows_x64\share\doc\ffms2" -Destination "doc" -Recurse | ||
| Copy-Item -Path "..\ffms2_windows_x64\include" -Destination "include" -Recurse | ||
| Copy-Item -Path "..\etc\*" -Destination "." | ||
| mkdir x86 | ||
| Copy-Item -Path "..\ffms2_windows_x86\bin\ffms2.dll" -Destination "x86" | ||
| Copy-Item -Path "..\ffms2_windows_x86\bin\ffmsindex.exe" -Destination "x86" | ||
| Copy-Item -Path "..\ffms2_windows_x86\lib\ffms2.lib" -Destination "x86" | ||
| mkdir x64 | ||
| Copy-Item -Path "..\ffms2_windows_x64\bin\ffms2.dll" -Destination "x64" | ||
| Copy-Item -Path "..\ffms2_windows_x64\bin\ffmsindex.exe" -Destination "x64" | ||
| Copy-Item -Path "..\ffms2_windows_x64\lib\ffms2.lib" -Destination "x64" | ||
| cd .. | ||
| 7z a "$env:RELEASE_TAG.7z" $env:RELEASE_TAG | ||
|
|
||
| - name: Upload artifact to GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| run: gh release upload '${{ github.ref_name }}' "$env:RELEASE_TAG.7z" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| name: Build on Windows | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master ] | ||
| pull_request: | ||
| branches: [ master ] | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| build-win: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| arch: [x86, x64] | ||
|
|
||
| name: "Test Windows MSVC (${{ matrix.arch }})" | ||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Install Meson | ||
| run: pip install meson | ||
|
|
||
| - name: Install ffmpeg | ||
| run: vcpkg install ffmpeg[avcodec,avdevice,avfilter,avformat,swresample,swscale,zlib,bzip2,core,dav1d,gpl,version3,lzma,openssl,xml2]:${{ matrix.arch }}-windows-static | ||
|
|
||
| - name: Set VCPKG_PATH environment variable | ||
| run: | | ||
| $vcpkg_path = Split-Path (Get-Command vcpkg).Source -Parent | ||
| echo "VCPKG_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
|
|
||
| - name: Install pkgconf | ||
| uses: msys2/setup-msys2@v2 | ||
| id: msys2 | ||
| with: | ||
| msystem: MINGW64 | ||
| install: mingw-w64-x86_64-pkgconf | ||
|
|
||
| - name: Setup MSVC Developer Command Prompt | ||
| uses: ilammy/msvc-dev-cmd@v1 | ||
| with: | ||
| arch: ${{ matrix.arch }} | ||
|
|
||
| - name: Configure with Meson | ||
| env: | ||
| PKG_CONFIG: "${{ steps.msys2.outputs.msys2-location }}\\mingw64\\bin\\pkg-config.EXE" | ||
| run: > | ||
| meson setup builddir | ||
| --buildtype=release | ||
| --vsenv | ||
| -Dtest=enabled | ||
| -Davisynth=enabled | ||
| --pkg-config-path="$env:VCPKG_PATH\installed\${{ matrix.arch }}-windows-static\lib\pkgconfig" | ||
| -Db_vscrt=mt | ||
| # Use "-Db_vscrt=mt" to avoid this warning: LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library | ||
|
|
||
| - name: Build | ||
| run: meson compile -C builddir --verbose | ||
|
|
||
| - name: Run tests | ||
| run: meson test -C builddir --verbose | ||
|
|
||
| - name: Install | ||
| run: meson install -C builddir --destdir install | ||
|
|
||
| - name: Upload Build | ||
| uses: actions/upload-artifact@v6 | ||
| with: | ||
| name: ffms2_windows_${{ matrix.arch }} | ||
| path: builddir/install |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +0,0 @@ | ||
| [submodule "test/googletest"] | ||
| path = test/googletest | ||
| url = https://github.com/google/googletest | ||
| branch = master | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.