Skip to content

Commit 8857d20

Browse files
committed
Do not pollute the cache when building for multiple platforms and architectures simultaneously
1 parent fde93df commit 8857d20

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

SConstruct

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,14 @@ if unknown:
4747

4848
scons_cache_path = os.environ.get("SCONS_CACHE")
4949
if scons_cache_path is not None:
50-
CacheDir(scons_cache_path)
50+
# Make the cache path unique for each platform and architecture
51+
platform_arch = env["PLATFORM"] + "." + env["arch"]
52+
platform_cache_path = os.path.join(scons_cache_path, platform_arch)
53+
if not os.path.exists(platform_cache_path):
54+
os.makedirs(platform_cache_path)
55+
56+
57+
CacheDir(platform_cache_path)
5158
Decider("MD5")
5259

5360
cpp_tool.generate(env)

0 commit comments

Comments
 (0)