Deleted stale check. Now SCons supports globbing with # inside path

Some parts of the buildsystem already were using it with `#` in path

Signed-off-by: Yevhen Babiichuk (DustDFG) <dfgdust@gmail.com>
This commit is contained in:
Yevhen Babiichuk (DustDFG) 2024-11-02 22:20:17 +02:00
parent c6c464cf9a
commit 81a032337c
2 changed files with 15 additions and 23 deletions

View File

@ -46,18 +46,18 @@ if env["builtin_libpng"]:
if "S_compiler" in env: if "S_compiler" in env:
env_neon["CC"] = env["S_compiler"] env_neon["CC"] = env["S_compiler"]
neon_sources = [] neon_sources = []
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/arm_init.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "arm/arm_init.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon_intrinsics.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon_intrinsics.c"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/filter_neon.S")) neon_sources.append(env_neon.Object(thirdparty_dir + "arm/filter_neon.S"))
neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.c")) neon_sources.append(env_neon.Object(thirdparty_dir + "arm/palette_neon_intrinsics.c"))
thirdparty_obj += neon_sources thirdparty_obj += neon_sources
elif env["arch"].startswith("x86"): elif env["arch"].startswith("x86"):
env_thirdparty.Append(CPPDEFINES=["PNG_INTEL_SSE"]) env_thirdparty.Append(CPPDEFINES=["PNG_INTEL_SSE"])
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/intel/intel_init.c") env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "intel/intel_init.c")
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/intel/filter_sse2_intrinsics.c") env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "intel/filter_sse2_intrinsics.c")
elif env["arch"] == "ppc64": elif env["arch"] == "ppc64":
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/powerpc/powerpc_init.c") env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "powerpc/powerpc_init.c")
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "/powerpc/filter_vsx_intrinsics.c") env_thirdparty.add_source_files(thirdparty_obj, thirdparty_dir + "powerpc/filter_vsx_intrinsics.c")
env.drivers_sources += thirdparty_obj env.drivers_sources += thirdparty_obj

View File

@ -73,21 +73,13 @@ def print_error(*values: object) -> None:
def add_source_files_orig(self, sources, files, allow_gen=False): def add_source_files_orig(self, sources, files, allow_gen=False):
# Convert string to list of absolute paths (including expanding wildcard) # Convert string to list of absolute paths (including expanding wildcard)
if isinstance(files, (str, bytes)): if isinstance(files, str):
# Keep SCons project-absolute path as they are (no wildcard support)
if files.startswith("#"):
if "*" in files:
print_error("Wildcards can't be expanded in SCons project-absolute path: '{}'".format(files))
return
files = [files]
else:
# Exclude .gen.cpp files from globbing, to avoid including obsolete ones. # Exclude .gen.cpp files from globbing, to avoid including obsolete ones.
# They should instead be added manually. # They should instead be added manually.
skip_gen_cpp = "*" in files skip_gen_cpp = "*" in files
dir_path = self.Dir(".").abspath files = self.Glob(files)
files = sorted(glob.glob(dir_path + "/" + files))
if skip_gen_cpp and not allow_gen: if skip_gen_cpp and not allow_gen:
files = [f for f in files if not f.endswith(".gen.cpp")] files = [f for f in files if not str(f).endswith(".gen.cpp")]
# Add each path as compiled Object following environment (self) configuration # Add each path as compiled Object following environment (self) configuration
for path in files: for path in files: