diff --git a/templates/cmd-make/Makefile b/templates/cmd-make/Makefile index 8071c81..59e3e11 100644 --- a/templates/cmd-make/Makefile +++ b/templates/cmd-make/Makefile @@ -33,7 +33,10 @@ endif PROGRAM = ${BUNDLE_NAME}${EXE_SUFFIX} -C_SRCS = ${COMMON_DIR}/src/main.c ${MIDI_PARSER_DIR}/src/midi-parser.c ${C_SRCS_EXTRA} +C_SRCS = ${COMMON_DIR}/src/main.c ${C_SRCS_EXTRA} +ifeq ($(HAS_MIDI_IN), yes) + C_SRCS += ${MIDI_PARSER_DIR}/src/midi-parser.c +endif C_OBJS = $(addprefix build/obj/, $(notdir $(C_SRCS:.c=.o))) CXX_SRCS = ${CXX_SRCS_EXTRA} diff --git a/templates/cmd-make/vars.mk b/templates/cmd-make/vars.mk index 65cca0a..efb4b23 100644 --- a/templates/cmd-make/vars.mk +++ b/templates/cmd-make/vars.mk @@ -13,3 +13,5 @@ PLUGIN_DIR := {{=it.cmd_make && it.cmd_make.pluginDir ? it.cmd_make.pluginDir : TINYWAV_DIR := {{=it.cmd_make.tinywavDir}} MIDI_PARSER_DIR := {{=it.cmd_make.midiParserDir}} + +HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}}