Merge pull request #382 from Zylann/fix_sconstruct_default_bits

Fix default value of `bits` misnaming resulting library
pull/451/head
Marc 2020-08-30 22:33:45 +01:00 committed by GitHub
commit fd281da1cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 15 deletions

View File

@ -68,6 +68,17 @@ else:
'platform=<platform>' 'platform=<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 = Variables([], ARGUMENTS)
opts.Add(EnumVariable( opts.Add(EnumVariable(
'platform', 'platform',
@ -79,8 +90,8 @@ opts.Add(EnumVariable(
opts.Add(EnumVariable( opts.Add(EnumVariable(
'bits', 'bits',
'Target platform bits', 'Target platform bits',
'default', '64' if is64 else '32',
('default', '32', '64') ('32', '64')
)) ))
opts.Add(BoolVariable( opts.Add(BoolVariable(
'use_llvm', 'use_llvm',
@ -150,22 +161,9 @@ opts.Add(BoolVariable(
True True
)) ))
env = Environment(ENV = os.environ)
opts.Update(env) opts.Update(env)
Help(opts.GenerateHelpText(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 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 # This way, you can run SCons in a Visual Studio 2017 prompt and it will find
# all the required tools # all the required tools