From 8f4a20e65b7421f67b2564d5cdad5e41b3c3b67c Mon Sep 17 00:00:00 2001 From: Kp Date: Sat, 14 Oct 2017 17:10:30 +0000 Subject: [PATCH] Set Environment CXX earlier SCons tries to probe the compiler designated by CXX before Environment() returns. Set CXX in the call to Environment so that it probes the correct tool. --- SConstruct | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/SConstruct b/SConstruct index 3e4eef7ef..642d9aca0 100644 --- a/SConstruct +++ b/SConstruct @@ -3728,11 +3728,6 @@ class DXXCommon(LazyObjectConstructor): target_string = ' -o $TARGET' env = self.env user_settings = self.user_settings - # Get traditional compiler environment variables - for cc in ('CXX', 'RC'): - value = getattr(user_settings, cc) - if value is not None: - env[cc] = value # Expand $CXX immediately. # $CCFLAGS is never used. Remove it. cxxcom = env['CXXCOM'] \ @@ -3850,7 +3845,14 @@ class DXXCommon(LazyObjectConstructor): def env(self): platform_settings = self.platform_settings # Acquire environment object... - env = Environment(ENV = os.environ, tools = platform_settings.tools + ('textfile',)) + user_settings = self.user_settings + # Get traditional compiler environment variables + kw = {} + for cc in ('CXX', 'RC'): + value = getattr(user_settings, cc) + if value is not None: + kw[cc] = value + env = Environment(ENV = os.environ, tools = platform_settings.tools + ('textfile',), **kw) platform_settings.adjust_environment(self, env) return env