Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fetch submodules for plugins that aren't being built #5182

Merged
merged 19 commits into from
Oct 3, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 34 additions & 1 deletion cmake/modules/CheckSubmodules.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SET(DEPTH_VALUE 100)
# Number of times git commands will retry before failing
SET(MAX_ATTEMPTS 2)

MESSAGE("\nValidating submodules...")
MESSAGE("\nChecking submodules...")
IF(NOT EXISTS "${CMAKE_SOURCE_DIR}/.gitmodules")
MESSAGE("Skipping the check because .gitmodules not detected."
"Please make sure you have all submodules in the source tree!"
Expand All @@ -46,6 +46,7 @@ SET(ENV{LANG} "en_US")
STRING(REGEX MATCHALL "path = [-0-9A-Za-z/]+" SUBMODULE_LIST ${SUBMODULE_DATA})
STRING(REGEX MATCHALL "url = [.:%-0-9A-Za-z/]+" SUBMODULE_URL_LIST ${SUBMODULE_DATA})

SET(SKIP_COUNT 0)
FOREACH(_part ${SUBMODULE_LIST})
tresf marked this conversation as resolved.
Show resolved Hide resolved
tresf marked this conversation as resolved.
Show resolved Hide resolved
STRING(REPLACE "path = " "" SUBMODULE_PATH ${_part})

Expand All @@ -59,6 +60,9 @@ FOREACH(_part ${SUBMODULE_LIST})
IF(${SUBMODULE_PATH} MATCHES "^plugins/")
SET(REMOVE_PLUGIN true)
FOREACH(_plugin ${PLUGIN_LIST})
IF(_plugin STREQUAL "")
CONTINUE()
ENDIF()
IF(${SUBMODULE_PATH} MATCHES "${_plugin}")
SET(REMOVE_PLUGIN false)
ENDIF()
Expand All @@ -76,6 +80,8 @@ FOREACH(_part ${SUBMODULE_LIST})
IF(${SUBMODULE_PATH} MATCHES ${_skip})
MESSAGE("-- Skipping ${SUBMODULE_PATH} matches \"${_skip}\" ${SKIP_REASON}")
SET(SKIP true)
MATH(EXPR SKIP_COUNT "${SKIP_COUNT}+1")
BREAK()
ENDIF()
ENDFOREACH()
ENDIF()
tresf marked this conversation as resolved.
Show resolved Hide resolved
Expand All @@ -87,6 +93,33 @@ FOREACH(_part ${SUBMODULE_LIST})
LIST(REMOVE_ITEM SUBMODULE_URL_LIST ${_url})
ENDFOREACH()

# Count provided values
SET(SKIP_SUBMODULES_LENGTH 0)
FOREACH(_skip ${SKIP_SUBMODULES})
MATH(EXPR SKIP_SUBMODULES_LENGTH "${SKIP_SUBMODULES_LENGTH}+1")
ENDFOREACH()

# Abort if skip count differs from provided values
IF(NOT SKIP_SUBMODULES_LENGTH EQUAL SKIP_COUNT)
SET(FATAL_MSG "One or more submodule(s) \"${SKIP_SUBMODULES}\" was not found, aborting.\
\nFor a list of supported values try -DLIST_SUBMODULES=True\n")
UNSET(SKIP_SUBMODULES CACHE)
MESSAGE(FATAL_ERROR "${FATAL_MSG}")
ENDIF()

IF(LIST_SUBMODULES)
UNSET(LIST_SUBMODULES CACHE)
tresf marked this conversation as resolved.
Show resolved Hide resolved
MESSAGE("\nAll possible -DSKIP_SUBMODULES values")
FOREACH(item IN LISTS SUBMODULE_LIST)
MESSAGE(" ${item}")
ENDFOREACH()
MESSAGE(
"\n"
"NOTE: A simple and more effective way to skip submodules is via -DPLUGIN_LIST.\n\n"
"See also -DLIST_PLUGINS=True for a complete list.\n"
)
MESSAGE(FATAL_ERROR "Information was requested, aborting build!")
ENDIF()

# Once called, status is stored in GIT_RESULT respectively.
# Note: Git likes to write to stderr. Don't assume stderr is error; Check GIT_RESULT instead.
Expand Down
117 changes: 69 additions & 48 deletions cmake/modules/PluginList.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -20,56 +20,77 @@ IF(LMMS_MINIMAL)
SET(PLUGIN_LIST ${MINIMAL_LIST} ${PLUGIN_LIST})
ENDIF()

SET(LMMS_PLUGIN_LIST
${MINIMAL_LIST}
Amplifier
BassBooster
bit_invader
Bitcrush
carlabase
carlapatchbay
carlarack
CrossoverEQ
Delay
DualFilter
dynamics_processor
Eq
Flanger
HydrogenImport
ladspa_browser
LadspaEffect
lb302
MidiImport
MidiExport
MultitapEcho
monstro
nes
OpulenZ
organic
FreeBoy
patman
peak_controller_effect
GigPlayer
ReverbSC
sf2_player
sfxr
sid
SpectrumAnalyzer
stereo_enhancer
stereo_matrix
stk
vst_base
vestige
VstEffect
watsyn
waveshaper
vibed
Xpressive
zynaddsubfx
)

IF("${PLUGIN_LIST}" STREQUAL "")
SET(PLUGIN_LIST
${MINIMAL_LIST}
Amplifier
BassBooster
bit_invader
Bitcrush
carlabase
carlapatchbay
carlarack
CrossoverEQ
Delay
DualFilter
dynamics_processor
Eq
Flanger
HydrogenImport
ladspa_browser
LadspaEffect
lb302
MidiImport
MidiExport
MultitapEcho
monstro
nes
OpulenZ
organic
FreeBoy
patman
peak_controller_effect
GigPlayer
ReverbSC
sf2_player
sfxr
sid
SpectrumAnalyzer
stereo_enhancer
stereo_matrix
stk
vst_base
vestige
VstEffect
watsyn
waveshaper
vibed
Xpressive
zynaddsubfx
)
SET(PLUGIN_LIST ${LMMS_PLUGIN_LIST})
ENDIF()

ENDIF("${PLUGIN_LIST}" STREQUAL "")
MACRO(LIST_ALL_PLUGINS)
MESSAGE("\n\nAll possible -DPLUGIN_LIST values")
MESSAGE("\n KEYWORD:")
MESSAGE(" LMMS_MINIMAL")
FOREACH(item IN LISTS MINIMAL_LIST)
MESSAGE(" ${item}")
ENDFOREACH()
MESSAGE("\n NAME:")
FOREACH(item IN LISTS LMMS_PLUGIN_LIST)
MESSAGE(" ${item}")
ENDFOREACH()
MESSAGE("\nNote: This value also impacts the fetching of git submodules.\n")
MESSAGE(FATAL_ERROR "Information was requested, aborting build!")
ENDMACRO()

IF(LIST_PLUGINS)
JohannesLorenz marked this conversation as resolved.
Show resolved Hide resolved
UNSET(LIST_PLUGINS CACHE)
LIST_ALL_PLUGINS()
ENDIF()

IF(MSVC)
SET(MSVC_INCOMPATIBLE_PLUGINS
Expand Down