Merge pull request #214 from marcelofg55/scons_improv_mf

Improvements on SConstruct arch detection
pull/187/head
Bastiaan Olij 2018-12-02 09:29:07 +11:00 committed by GitHub
commit 607b8326a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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'