diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a672782752..6ee5bfcb13 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,12 +23,18 @@ jobs: - os: macos-latest cc: clang cxx: clang++ + - os: windows-latest + cc: gcc + cxx: g++ name: "Test (${{ matrix.os }}, ${{ matrix.cc }})" runs-on: ${{ matrix.os }} env: CC: ${{ matrix.cc }} CXX: ${{ matrix.cxx }} + defaults: + run: + shell: ${{ matrix.os == 'windows-latest' && 'msys2 {0}' || 'bash' }} steps: - uses: actions/checkout@v4 @@ -45,6 +51,15 @@ jobs: run: | brew update brew install autoconf automake libtool wget ffmpeg + - name: Setup msys2 + if: matrix.os == 'windows-latest' + uses: msys2/setup-msys2@v2 + with: + msystem: MINGW64 + install: >- + mingw-w64-x86_64-autotools + mingw-w64-x86_64-ffmpeg + mingw-w64-x86_64-toolchain - name: configure run: ./autogen.sh --enable-static --disable-shared - name: make diff --git a/Makefile.am b/Makefile.am index 05631fda9c..644f3e14ca 100644 --- a/Makefile.am +++ b/Makefile.am @@ -56,6 +56,9 @@ include_HEADERS = $(top_srcdir)/include/ffms.h $(top_srcdir)/include/ffmscompat. bin_PROGRAMS = src/index/ffmsindex src_index_ffmsindex_SOURCES = src/index/ffmsindex.cpp +if WINDOWS +src_index_ffmsindex_LDFLAGS = -municode +endif src_index_ffmsindex_LDADD = -lavutil src/core/libffms2.la .PHONY: test test-build test-clean test-sync test-run diff --git a/configure.ac b/configure.ac index b875b30911..79cb85dcee 100644 --- a/configure.ac +++ b/configure.ac @@ -58,6 +58,8 @@ AS_CASE([$host], AC_ENABLE_SHARED AC_DISABLE_STATIC]) +AM_CONDITIONAL([WINDOWS], [case "$host_os" in mingw* | cygwin*) true ;; *) false ;; esac]) + AC_PROG_LIBTOOL if echo "$host" | $GREP "cygwin" >/dev/null 2>&1 && test "$enable_shared" = "yes"; then