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

🔨 src_filter is deprecated #25810

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
22 changes: 11 additions & 11 deletions buildroot/share/PlatformIO/scripts/common-dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def add_to_feat_cnf(feature, flines):
for line in atoms:
parts = line.split('=')
name = parts.pop(0)
if name in ['build_flags', 'extra_scripts', 'src_filter', 'lib_ignore']:
if name in ['build_flags', 'extra_scripts', 'build_src_filter', 'lib_ignore']:
feat[name] = '='.join(parts)
blab("[%s] %s=%s" % (feature, name, feat[name]), 3)
else:
Expand Down Expand Up @@ -130,7 +130,7 @@ def force_ignore_unused_libs():
def apply_features_config():
load_features()
blab("========== Apply enabled features...")
build_filters = ' '.join(env.GetProjectOption('src_filter'))
build_filters = ' '.join(env.GetProjectOption('build_src_filter'))
for feature in FEATURE_CONFIG:
if not env.MarlinHas(feature):
continue
Expand Down Expand Up @@ -175,9 +175,9 @@ def apply_features_config():
blab("Running extra_scripts for %s... " % feature, 2)
env.SConscript(feat['extra_scripts'], exports="env")

if 'src_filter' in feat:
if 'build_src_filter' in feat:
blab("========== Adding build_src_filter for %s... " % feature, 2)
build_filters = build_filters + ' ' + feat['src_filter']
build_filters = build_filters + ' ' + feat['build_src_filter']
# Just append the filter in the order that the build environment specifies.
# Important here is the order of entries in the "features.ini" file.

Expand All @@ -186,7 +186,7 @@ def apply_features_config():
lib_ignore = env.GetProjectOption('lib_ignore') + [feat['lib_ignore']]
set_env_field('lib_ignore', lib_ignore)

src_filter = ""
build_src_filter = ""
if True:
# Build the actual equivalent build_src_filter list based on the inclusions by the features.
# PlatformIO doesn't do it this way, but maybe in the future....
Expand Down Expand Up @@ -247,16 +247,16 @@ def filt(x):
cur_srcs = set(filter(filt, cur_srcs))
# Transform the resulting set into a string.
for x in cur_srcs:
if len(src_filter) > 0: src_filter += ' '
src_filter += "+<" + x + ">"
if len(build_src_filter) > 0: build_src_filter += ' '
build_src_filter += "+<" + x + ">"

#blab("Final src_filter: " + src_filter)
#blab("Final build_src_filter: " + build_src_filter)
else:
src_filter = build_filters
build_src_filter = build_filters

# Update in PlatformIO
set_env_field('build_src_filter', [src_filter])
env.Replace(SRC_FILTER=src_filter)
set_env_field('build_src_filter', [build_src_filter])
env.Replace(SRC_FILTER=build_src_filter)

#
# Use the compiler to get a list of all enabled features
Expand Down
Loading