Skip to content

Commit 434b71f

Browse files
authored
cmake: add support for triplet x64-mingw-static (Vita3K#15)
* cmake: add support for triplet x64-mingw-static * rename build to mingw
1 parent 29123c3 commit 434b71f

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

.github/workflows/build.yml

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
12
name: C/C++ CI
23

34
on: [push]
@@ -24,6 +25,12 @@ jobs:
2425
triplet: win-llvm-static-release
2526
vcpkg-root: C:\vcpkg
2627
extra-args: --overlay-triplets=./triplets
28+
- build: mingw
29+
os: windows-latest
30+
triplet: mingw-static
31+
vcpkg-root: C:\vcpkg
32+
arch: x64
33+
extra-args: ""
2734
- build: macos
2835
os: macos-latest
2936
triplet: osx-release
@@ -37,6 +44,17 @@ jobs:
3744
extra-args: --overlay-triplets=./triplets
3845

3946
steps:
47+
- run: git config --global core.autocrlf input
48+
- uses: msys2/setup-msys2@v2
49+
id: msys2
50+
with:
51+
msystem: CLANG64
52+
update: true
53+
pacboy: >-
54+
toolchain:p
55+
cmake:p
56+
ninja:p
57+
if: matrix.triplet == 'mingw-static'
4058
- uses: actions/checkout@v4
4159

4260
- name: Set up build environment (macos-latest)
@@ -65,7 +83,15 @@ jobs:
6583
6684
- name: Build ffmpeg
6785
run: |
68-
vcpkg ${{ matrix.extra-args }} install ffmpeg[avcodec,avfilter,avdevice,avformat,swresample,swscale]:${{ matrix.arch }}-${{ matrix.triplet }}
86+
vcpkg ${{ matrix.extra-args }} install ffmpeg[avcodec,avfilter,avdevice,avformat,swresample,swscale]:${{ matrix.arch }}-${{ matrix.triplet }}
87+
if: matrix.triplet != 'mingw-static'
88+
89+
- name: Build ffmpeg (x64-mingw-static)
90+
shell: msys2 {0}
91+
run: |
92+
export PATH=$(cygpath '${{ matrix.vcpkg-root }}'):$PATH
93+
vcpkg ${{ matrix.extra-args }} install ffmpeg[avcodec,avfilter,avdevice,avformat,swresample,swscale]:${{ matrix.arch }}-${{ matrix.triplet }}
94+
if: matrix.triplet == 'mingw-static'
6995

7096
- uses: actions/upload-artifact@v4
7197
with:

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ elseif (APPLE)
1313
set(FFMPEG_PREBUILTS_NAME "ffmpeg-macos")
1414
elseif (UNIX)
1515
set(FFMPEG_PREBUILTS_NAME "ffmpeg-linux")
16+
elseif (MINGW)
17+
set(FFMPEG_PREBUILTS_NAME "ffmpeg-mingw")
1618
else ()
1719
message(FATAL_ERROR "Unsupported OS.")
1820
endif ()
@@ -76,4 +78,4 @@ target_link_libraries(${FFMPEG_CORE_NAME} INTERFACE
7678
"${CMAKE_BINARY_DIR}/external/ffmpeg/lib/${LIB_PREFIX}swscale.${LIB_EXT}"
7779
"${CMAKE_BINARY_DIR}/external/ffmpeg/lib/${LIB_PREFIX}avutil.${LIB_EXT}"
7880
"${CMAKE_BINARY_DIR}/external/ffmpeg/lib/${LIB_PREFIX}avfilter.${LIB_EXT}"
79-
"${CMAKE_BINARY_DIR}/external/ffmpeg/lib/${LIB_PREFIX}swresample.${LIB_EXT}")
81+
"${CMAKE_BINARY_DIR}/external/ffmpeg/lib/${LIB_PREFIX}swresample.${LIB_EXT}")

0 commit comments

Comments
 (0)