Skip to content

Commit

Permalink
Add WITHAUDIO=yes build to CI; fix missing vorbis warning in no audio…
Browse files Browse the repository at this point in the history
… build

Signed-off-by: Stephen M. Cameron <stephenmcameron@gmail.com>
  • Loading branch information
cxong authored and smcameron committed Oct 19, 2021
1 parent eaba726 commit f5559e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
14 changes: 11 additions & 3 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ jobs:

runs-on: ubuntu-latest

strategy:
matrix:
include:
- withaudio: no
packages: "gtk2.0"
- withaudio: yes
packages: "gtk2.0 libvorbis-dev portaudio19-dev"

steps:
- uses: actions/checkout@v2
- name: Install packages
run: sudo apt-get update && sudo apt-get install gtk2.0
- name: make (no audio)
run: make WITHAUDIO=no
run: sudo apt-get update && sudo apt-get install ${{ matrix.packages }}
- name: make
run: make WITHAUDIO=${{ matrix.withaudio }}
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ WITHAUDIO=yes

ifeq (${WITHAUDIO},yes)
SNDLIBS=`$(PKG_CONFIG) --libs portaudio-2.0 vorbisfile`
VORBISLIBS=`$(PKG_CONFIG) --cflags vorbisfile`
SNDFLAGS=-DWITHAUDIOSUPPORT `$(PKG_CONFIG) --cflags portaudio-2.0`
OGGOBJ=ogg_to_pcm.o
else
SNDLIBS=
VORBISLIBS=
SNDFLAGS=-DWWVIAUDIO_STUBS_ONLY
OGGOBJ=
endif
Expand Down Expand Up @@ -82,17 +84,17 @@ joystick.o: joystick.c joystick.h Makefile
$(CC) ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} -pthread ${WARNFLAG} -c joystick.c

ogg_to_pcm.o: ogg_to_pcm.c ogg_to_pcm.h Makefile
$(CC) ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} `$(PKG_CONFIG) --cflags vorbisfile` \
$(CC) ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} ${VORBISLIBS} \
-pthread ${WARNFLAG} -c ogg_to_pcm.c

wwviaudio.o: wwviaudio.c wwviaudio.h ogg_to_pcm.h my_point.h Makefile
$(CC) ${WARNFLAG} ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} \
${DEFINES} \
-pthread `$(PKG_CONFIG) --cflags vorbisfile` \
-pthread ${VORBISLIBS} \
-c wwviaudio.c

rumble.o: rumble.c rumble.h Makefile
$(CC) ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} `$(PKG_CONFIG) --cflags vorbisfile` \
$(CC) ${DEBUG} ${PROFILE_FLAG} ${OPTIMIZE_FLAG} ${VORBISLIBS} \
-pthread ${WARNFLAG} -c rumble.c

wwvi_font.o: wwvi_font.c wwvi_font.h my_point.h Makefile
Expand Down

0 comments on commit f5559e9

Please sign in to comment.