From 81a032337c834d79a2e21a5782de33ce792bde6a Mon Sep 17 00:00:00 2001 From: "Yevhen Babiichuk (DustDFG)" Date: Sat, 2 Nov 2024 22:20:17 +0200 Subject: [PATCH] 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) --- drivers/png/SCsub | 16 ++++++++-------- methods.py | 22 +++++++--------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/drivers/png/SCsub b/drivers/png/SCsub index fce37257b16..4268a664750 100644 --- a/drivers/png/SCsub +++ b/drivers/png/SCsub @@ -46,18 +46,18 @@ if env["builtin_libpng"]: if "S_compiler" in env: env_neon["CC"] = env["S_compiler"] neon_sources = [] - 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.S")) - neon_sources.append(env_neon.Object(thirdparty_dir + "/arm/palette_neon_intrinsics.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.S")) + neon_sources.append(env_neon.Object(thirdparty_dir + "arm/palette_neon_intrinsics.c")) thirdparty_obj += neon_sources elif env["arch"].startswith("x86"): 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/filter_sse2_intrinsics.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") 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/filter_vsx_intrinsics.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.drivers_sources += thirdparty_obj diff --git a/methods.py b/methods.py index 65b88a5c656..6f8b11819bd 100644 --- a/methods.py +++ b/methods.py @@ -73,21 +73,13 @@ def print_error(*values: object) -> None: def add_source_files_orig(self, sources, files, allow_gen=False): # Convert string to list of absolute paths (including expanding wildcard) - if isinstance(files, (str, bytes)): - # 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. - # They should instead be added manually. - skip_gen_cpp = "*" in files - dir_path = self.Dir(".").abspath - files = sorted(glob.glob(dir_path + "/" + files)) - if skip_gen_cpp and not allow_gen: - files = [f for f in files if not f.endswith(".gen.cpp")] + if isinstance(files, str): + # Exclude .gen.cpp files from globbing, to avoid including obsolete ones. + # They should instead be added manually. + skip_gen_cpp = "*" in files + files = self.Glob(files) + if skip_gen_cpp and not allow_gen: + files = [f for f in files if not str(f).endswith(".gen.cpp")] # Add each path as compiled Object following environment (self) configuration for path in files: