Skip to content

Commit c6090d4

Browse files
committed
Update makefiles
1 parent d5aad58 commit c6090d4

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

common.mk

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ ifndef SFIZZ_DIR
44
$(error sfizz: The source directory must be set before including)
55
endif
66

7+
### Options
8+
9+
SFIZZ_USE_SNDFILE ?= 1
10+
711
###
812

913
SFIZZ_MACHINE := $(shell $(CC) -dumpmachine)
@@ -125,13 +129,15 @@ SFIZZ_PKG_CONFIG ?= pkg-config
125129

126130
# Sndfile dependency
127131

132+
ifeq ($(SFIZZ_USE_SNDFILE),1)
128133
SFIZZ_SNDFILE_C_FLAGS ?= $(shell $(SFIZZ_PKG_CONFIG) --cflags sndfile)
129134
SFIZZ_SNDFILE_CXX_FLAGS ?= $(SFIZZ_SNDFILE_C_FLAGS)
130135
SFIZZ_SNDFILE_LINK_FLAGS ?= $(shell $(SFIZZ_PKG_CONFIG) --libs sndfile)
131136

132-
SFIZZ_C_FLAGS += $(SFIZZ_SNDFILE_C_FLAGS)
133-
SFIZZ_CXX_FLAGS += $(SFIZZ_SNDFILE_CXX_FLAGS)
137+
SFIZZ_C_FLAGS += $(SFIZZ_SNDFILE_C_FLAGS) -DST_AUDIO_FILE_USE_SNDFILE=1
138+
SFIZZ_CXX_FLAGS += $(SFIZZ_SNDFILE_CXX_FLAGS) -DST_AUDIO_FILE_USE_SNDFILE=1
134139
SFIZZ_LINK_FLAGS += $(SFIZZ_SNDFILE_LINK_FLAGS)
140+
endif
135141

136142
### Abseil dependency
137143

rack.mk

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#
3030
# SFIZZ_RACK_PLUGIN_DIR = <the root directory of the Rack plugin>
3131
# SFIZZ_PKG_CONFIG = <a custom pkg-config command>
32+
# SFIZZ_USE_SNDFILE = <0 disabled, 1 enabled (default)>
3233
# SFIZZ_SNDFILE_C_FLAGS = <compiler flags of sndfile for C>
3334
# SFIZZ_SNDFILE_CXX_FLAGS = <compiler flags of sndfile for C++>
3435
# SFIZZ_SNDFILE_LINK_FLAGS = <linker flags of sndfile>

0 commit comments

Comments
 (0)