make: fix '--plugins=' option not being respected in all cases

If the list of plugins given to configure did not include
a subdir-based plugin, then all subdir-based plugins would
be built (since SELECTED_PLUGINS_SUBDIRS is empty then).

To prevent this issue use an explicit value ('DEFAULT') to
signal that we want to build the standard set of plugins.

Change-Id: I42d9dc8d754ed9ac1cd4b5c62c0a106ca3dfcd91
This commit is contained in:
Aidan MacDonald 2026-03-06 14:33:31 +00:00
parent a5853b1173
commit d6d4ff7af2
2 changed files with 8 additions and 4 deletions

View file

@ -20,7 +20,7 @@ ifeq ($(APP_TYPE),ctru-app)
is_app_build =
endif
ifdef SELECTED_PLUGINS_SRC
ifneq ($(SELECTED_PLUGINS_SRC),DEFAULT)
PLUGINS_SRC = $(SELECTED_PLUGINS_SRC)
else
ifdef is_app_build
@ -28,7 +28,7 @@ PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES.app_build)
else
PLUGINS_SRC = $(call preprocess, $(APPSDIR)/plugins/SOURCES)
endif
endif # ifdef SELECTED_PLUGINS_SRC
endif # if SELECTED_PLUGINS_SRC
OTHER_SRC += $(PLUGINS_SRC)
ROCKS1 := $(PLUGINS_SRC:.c=.rock)
ROCKS1 := $(call full_path_subst,$(ROOTDIR)/%,$(BUILDDIR)/%,$(ROCKS1))
@ -62,7 +62,7 @@ endif
OTHER_SRC += $(ROOTDIR)/apps/plugins/plugin_crt0.c
PLUGIN_CRT0 := $(BUILDDIR)/apps/plugins/plugin_crt0.o
# multifile plugins (subdirs):
ifdef SELECTED_PLUGINS_SUBDIRS
ifneq ($(SELECTED_PLUGINS_SUBDIRS),DEFAULT)
PLUGINSUBDIRS := $(SELECTED_PLUGINS_SUBDIRS)
else
ifdef is_app_build
@ -70,7 +70,7 @@ PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS.app_build)
else
PLUGINSUBDIRS := $(call preprocess, $(APPSDIR)/plugins/SUBDIRS)
endif
endif # ifdef SELECTED_PLUGINS_SUBDIRS
endif # if SELECTED_PLUGINS_SUBDIRS
PLUGIN_LIBS := $(PLUGINLIB) $(PLUGINBITMAPLIB) $(SETJMPLIB) $(FIXEDPOINTLIB)