losing my mind

This commit is contained in:
Anthony Samms
2025-09-15 19:18:03 -04:00
parent 2219a45571
commit 4eab0ccce7
2 changed files with 35 additions and 18 deletions

View File

@@ -25,6 +25,7 @@ jobs:
brew update
brew install portaudio libsndfile libsamplerate pkg-config
# Use MSYS2 for Windows audio library build with all codec dependencies
- name: Set up MSYS2 (Windows)
if: runner.os == 'Windows'
uses: msys2/setup-msys2@v2
@@ -40,6 +41,9 @@ jobs:
mingw-w64-x86_64-libvorbis
mingw-w64-x86_64-libogg
mingw-w64-x86_64-opus
mingw-w64-x86_64-mpg123
mingw-w64-x86_64-lame
mingw-w64-x86_64-speex
- name: Build static audio library (Windows)
if: runner.os == 'Windows'
@@ -50,7 +54,7 @@ jobs:
make clean
# Build with static linking
make all
make static
# Verify the build
make verify

View File

@@ -21,7 +21,7 @@ ifneq (,$(findstring MINGW,$(UNAME_S)))
CFLAGS = -Wall -Wextra -O3 -fPIC -std=c99 -I/mingw64/include -m64
LDFLAGS = -shared -Wl,--export-all-symbols -static-libgcc -static-libstdc++ -L/mingw64/lib -m64
# Core libraries (try static first, fall back to dynamic)
# Core libraries with full dependency chain
CORE_LIBS =
ifneq (,$(wildcard /mingw64/lib/libportaudio.a))
CORE_LIBS += /mingw64/lib/libportaudio.a
@@ -29,10 +29,35 @@ ifneq (,$(findstring MINGW,$(UNAME_S)))
CORE_LIBS += -lportaudio
endif
# libsndfile and ALL its dependencies (order matters!)
ifneq (,$(wildcard /mingw64/lib/libsndfile.a))
CORE_LIBS += /mingw64/lib/libsndfile.a
# libsndfile codec dependencies
ifneq (,$(wildcard /mingw64/lib/libFLAC.a))
CORE_LIBS += /mingw64/lib/libFLAC.a
endif
ifneq (,$(wildcard /mingw64/lib/libvorbisenc.a))
CORE_LIBS += /mingw64/lib/libvorbisenc.a /mingw64/lib/libvorbisfile.a /mingw64/lib/libvorbis.a
endif
ifneq (,$(wildcard /mingw64/lib/libogg.a))
CORE_LIBS += /mingw64/lib/libogg.a
endif
ifneq (,$(wildcard /mingw64/lib/libopus.a))
CORE_LIBS += /mingw64/lib/libopus.a
endif
ifneq (,$(wildcard /mingw64/lib/libmpg123.a))
CORE_LIBS += /mingw64/lib/libmpg123.a
endif
ifneq (,$(wildcard /mingw64/lib/libmp3lame.a))
CORE_LIBS += /mingw64/lib/libmp3lame.a
endif
ifneq (,$(wildcard /mingw64/lib/libspeex.a))
CORE_LIBS += /mingw64/lib/libspeex.a
endif
else
CORE_LIBS += -lsndfile
# Dynamic linking with all dependencies
CORE_LIBS += -lsndfile -lFLAC -lvorbisenc -lvorbisfile -lvorbis -logg -lopus -lmpg123 -lmp3lame -lspeex
endif
ifneq (,$(wildcard /mingw64/lib/libsamplerate.a))
@@ -41,22 +66,10 @@ ifneq (,$(findstring MINGW,$(UNAME_S)))
CORE_LIBS += -lsamplerate
endif
# Optional codec libraries
CODEC_LIBS =
ifneq (,$(wildcard /mingw64/lib/libFLAC.a))
CODEC_LIBS += /mingw64/lib/libFLAC.a
endif
ifneq (,$(wildcard /mingw64/lib/libvorbisenc.a))
CODEC_LIBS += /mingw64/lib/libvorbisenc.a /mingw64/lib/libvorbisfile.a /mingw64/lib/libvorbis.a
endif
ifneq (,$(wildcard /mingw64/lib/libogg.a))
CODEC_LIBS += /mingw64/lib/libogg.a
endif
# System libraries (always dynamic)
SYSTEM_LIBS = -lwinmm -lole32 -luuid -lksuser -lsetupapi -lws2_32 -ladvapi32
# System libraries
SYSTEM_LIBS = -lwinmm -lole32 -luuid -lksuser -lsetupapi -lws2_32
LIBS = $(CORE_LIBS) $(CODEC_LIBS) $(SYSTEM_LIBS)
LIBS = $(CORE_LIBS) $(SYSTEM_LIBS)
OBJ_EXT = .o
else ifeq ($(UNAME_S),Darwin)