Improvements on SConstruct arch detection

pull/214/head
Marcelo Fernandez 2018-11-28 14:19:50 -03:00
parent bcc39bbf4b
commit 2500f308a9
1 changed files with 6 additions and 2 deletions

View File

@ -38,7 +38,7 @@ opts.Add(BoolVariable('generate_bindings', 'Generate GDNative API bindings', Fal
unknown = opts.UnknownVariables() unknown = opts.UnknownVariables()
if unknown: if unknown:
print "Unknown variables:", unknown.keys() print("Unknown variables:" + unknown.keys())
Exit(1) Exit(1)
env = Environment() env = Environment()
@ -52,9 +52,13 @@ if env['platform'] == 'windows':
env = Environment(TARGET_ARCH='amd64') env = Environment(TARGET_ARCH='amd64')
elif env['bits'] == '32': elif env['bits'] == '32':
env = Environment(TARGET_ARCH='x86') env = Environment(TARGET_ARCH='x86')
else:
print("Warning: bits argument not specified, target arch is=" + env['TARGET_ARCH'])
opts.Update(env) opts.Update(env)
is64 = sys.maxsize > 2**32 is64 = False
if (env['TARGET_ARCH'] == 'amd64' or env['TARGET_ARCH'] == 'emt64' or env['TARGET_ARCH'] == 'x86_64'):
is64 = True
if env['bits'] == 'default': if env['bits'] == 'default':
env['bits'] = '64' if is64 else '32' env['bits'] = '64' if is64 else '32'