From 6d84b7aba440da70b6fb4cccdd4182109aa2a275 Mon Sep 17 00:00:00 2001 From: MBCX Date: Sun, 9 Nov 2025 10:22:16 -0400 Subject: [PATCH] Do not pollute the cache when building for multiple platforms and architectures simultaneously --- SConstruct | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 3ebdff941..fbee9bf66 100644 --- a/SConstruct +++ b/SConstruct @@ -47,7 +47,13 @@ if unknown: scons_cache_path = os.environ.get("SCONS_CACHE") if scons_cache_path is not None: - CacheDir(scons_cache_path) + # Make the cache path unique for each platform and architecture + platform_arch = env["PLATFORM"] + "." + env["arch"] + platform_cache_path = os.path.join(scons_cache_path, platform_arch) + if not os.path.exists(platform_cache_path): + os.makedirs(platform_cache_path) + + CacheDir(platform_cache_path) Decider("MD5") cpp_tool.generate(env)