Skip to content

Commit 8536506

Browse files
committed
Merge pull request godotengine#98774 from dustdfg/scons_use_glob_remove_stale_check
Delete stale check, make SCons support globbing with `#` inside path
2 parents 2b49543 + 81a0323 commit 8536506

File tree

2 files changed

+15
-23
lines changed

2 files changed

+15
-23
lines changed

drivers/png/SCsub

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,18 +46,18 @@ if env["builtin_libpng"]:
4646
if "S_compiler" in env:
4747
env_neon["CC"] = env["S_compiler"]
4848
neon_sources = []
49-
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c"))
50-
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c"))
51-
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S"))
52-
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c"))
49+
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/arm_init.c"))
50+
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon_intrinsics.c"))
51+
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon.S"))
52+
neon_sources.append(env_neon.Object(thirdparty_dir + "arm/palette_neon_intrinsics.c"))
5353
thirdparty_obj += neon_sources
5454
elif env["arch"].startswith("x86"):
5555
env_thirdparty.Append(CPPDEFINES=["PNG_INTEL_SSE"])
56-
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/intel/intel_init.c")
57-
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/intel/filter_sse2_intrinsics.c")
56+
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "intel/intel_init.c")
57+
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "intel/filter_sse2_intrinsics.c")
5858
elif env["arch"] == "ppc64":
59-
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/powerpc/powerpc_init.c")
60-
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/powerpc/filter_vsx_intrinsics.c")
59+
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "powerpc/powerpc_init.c")
60+
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "powerpc/filter_vsx_intrinsics.c")
6161

6262
env.drivers_sources += thirdparty_obj
6363

methods.py

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,13 @@ def print_error(*values: object) -> None:
7373

7474
def add_source_files_orig(self, sources, files, allow_gen=False):
7575
# Convert string to list of absolute paths (including expanding wildcard)
76-
if isinstance(files, (str, bytes)):
77-
# Keep SCons project-absolute path as they are (no wildcard support)
78-
if files.startswith("#"):
79-
if "*" in files:
80-
print_error("Wildcards can't be expanded in SCons project-absolute path: '{}'".format(files))
81-
return
82-
files = [files]
83-
else:
84-
# Exclude .gen.cpp files from globbing, to avoid including obsolete ones.
85-
# They should instead be added manually.
86-
skip_gen_cpp = "*" in files
87-
dir_path = self.Dir(".").abspath
88-
files = sorted(glob.glob(dir_path + "/" + files))
89-
if skip_gen_cpp and not allow_gen:
90-
files = [f for f in files if not f.endswith(".gen.cpp")]
76+
if isinstance(files, str):
77+
# Exclude .gen.cpp files from globbing, to avoid including obsolete ones.
78+
# They should instead be added manually.
79+
skip_gen_cpp = "*" in files
80+
files = self.Glob(files)
81+
if skip_gen_cpp and not allow_gen:
82+
files = [f for f in files if not str(f).endswith(".gen.cpp")]
9183

9284
# Add each path as compiled Object following environment (self) configuration
9385
for path in files:

0 commit comments

Comments
 (0)