diff --git a/SConstruct b/SConstruct index b63ee57d..e6a09418 100644 --- a/SConstruct +++ b/SConstruct @@ -68,6 +68,17 @@ else: 'platform=' ) +env = Environment(ENV = os.environ) + +is64 = sys.maxsize > 2**32 +if ( + env['TARGET_ARCH'] == 'amd64' or + env['TARGET_ARCH'] == 'emt64' or + env['TARGET_ARCH'] == 'x86_64' or + env['TARGET_ARCH'] == 'arm64-v8a' +): + is64 = True + opts = Variables([], ARGUMENTS) opts.Add(EnumVariable( 'platform', @@ -79,8 +90,8 @@ opts.Add(EnumVariable( opts.Add(EnumVariable( 'bits', 'Target platform bits', - 'default', - ('default', '32', '64') + '64' if is64 else '32', + ('32', '64') )) opts.Add(BoolVariable( 'use_llvm', @@ -150,22 +161,9 @@ opts.Add(BoolVariable( True )) -env = Environment(ENV = os.environ) opts.Update(env) Help(opts.GenerateHelpText(env)) -is64 = sys.maxsize > 2**32 -if ( - env['TARGET_ARCH'] == 'amd64' or - env['TARGET_ARCH'] == 'emt64' or - env['TARGET_ARCH'] == 'x86_64' or - env['TARGET_ARCH'] == 'arm64-v8a' -): - is64 = True - -if env['bits'] == 'default': - env['bits'] = '64' if is64 else '32' - # This makes sure to keep the session environment variables on Windows. # This way, you can run SCons in a Visual Studio 2017 prompt and it will find # all the required tools