You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-06 17:25:19 +00:00
Make build scripts Scons 3.0/Python3 compatible
- Cherry picked #10662 and fixed merge conflicts. - Manualy merged the change from #11904. - Did not merge #12236 since I'm not sure whether the issue affects Godot 2.1 and I don't have VS2013 to test. - Did not merge #11843 since it doesn't seem relevant (the code is only needed for creating DONORS.md, etc.). - Did not merge #10727 and #11752 since they seem to be already included in #11742. - The Windows and Linux builds have been tested with Scons 3.0 using Python 3. - OSX and iOS should hopefully work but are not tested since I don't have a Mac. - Builds using SCons 2.5 and Python 2 should not be impacted.
This commit is contained in:
@@ -13,12 +13,7 @@ def get_name():
|
||||
|
||||
|
||||
def can_build():
|
||||
|
||||
import os
|
||||
if (not os.environ.has_key("ANDROID_NDK_ROOT")):
|
||||
return False
|
||||
|
||||
return True
|
||||
return ("ANDROID_NDK_ROOT" in os.environ)
|
||||
|
||||
|
||||
def get_opts():
|
||||
@@ -60,7 +55,7 @@ def configure(env):
|
||||
import subprocess
|
||||
|
||||
def mySubProcess(cmdline, env):
|
||||
# print "SPAWNED : " + cmdline
|
||||
# print("SPAWNED : " + cmdline)
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
|
||||
@@ -68,9 +63,9 @@ def configure(env):
|
||||
data, err = proc.communicate()
|
||||
rv = proc.wait()
|
||||
if rv:
|
||||
print "====="
|
||||
print err
|
||||
print "====="
|
||||
print("=====")
|
||||
print(err)
|
||||
print("=====")
|
||||
return rv
|
||||
|
||||
def mySpawn(sh, escape, cmd, args, env):
|
||||
@@ -167,9 +162,8 @@ def configure(env):
|
||||
common_opts = ['-fno-integrated-as', '-gcc-toolchain', gcc_toolchain_path]
|
||||
|
||||
env.Append(CPPFLAGS=["-isystem", sysroot + "/usr/include"])
|
||||
env.Append(CPPFLAGS=string.split(
|
||||
'-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'))
|
||||
env.Append(CPPFLAGS=string.split('-DNO_STATVFS -DGLES2_ENABLED'))
|
||||
env.Append(CPPFLAGS='-fpic -ffunction-sections -funwind-tables -fstack-protector-strong -fvisibility=hidden -fno-strict-aliasing'.split())
|
||||
env.Append(CPPFLAGS='-DNO_STATVFS -DGLES2_ENABLED'.split())
|
||||
|
||||
env['neon_enabled'] = False
|
||||
if env['android_arch'] == 'x86':
|
||||
@@ -180,13 +174,12 @@ def configure(env):
|
||||
elif env["android_arch"] == "armv6":
|
||||
can_vectorize = False
|
||||
target_opts = ['-target', 'armv6-none-linux-androideabi']
|
||||
env.Append(CPPFLAGS=string.split(
|
||||
'-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'))
|
||||
env.Append(CPPFLAGS='-D__ARM_ARCH_6__ -march=armv6 -mfpu=vfp -mfloat-abi=softfp'.split())
|
||||
|
||||
elif env["android_arch"] == "armv7":
|
||||
can_vectorize = True
|
||||
target_opts = ['-target', 'armv7-none-linux-androideabi']
|
||||
env.Append(CPPFLAGS=string.split(
|
||||
'-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'))
|
||||
env.Append(CPPFLAGS='-D__ARM_ARCH_7__ -D__ARM_ARCH_7A__ -march=armv7-a -mfloat-abi=softfp'.split())
|
||||
if env['android_neon'] == 'yes':
|
||||
env['neon_enabled'] = True
|
||||
env.Append(CPPFLAGS=['-mfpu=neon', '-D__ARM_NEON__'])
|
||||
@@ -205,12 +198,9 @@ def configure(env):
|
||||
|
||||
env['LINKFLAGS'] = ['-shared', '--sysroot=' +
|
||||
sysroot, '-Wl,--warn-shared-textrel']
|
||||
env.Append(LINKFLAGS=string.split(
|
||||
'-Wl,--fix-cortex-a8'))
|
||||
env.Append(LINKFLAGS=string.split(
|
||||
'-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'))
|
||||
env.Append(LINKFLAGS=string.split(
|
||||
'-Wl,-soname,libgodot_android.so -Wl,--gc-sections'))
|
||||
env.Append(LINKFLAGS='-Wl,--fix-cortex-a8'.split())
|
||||
env.Append(LINKFLAGS='-Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now'.split())
|
||||
env.Append(LINKFLAGS='-Wl,-soname,libgodot_android.so -Wl,--gc-sections'.split())
|
||||
if mt_link:
|
||||
env.Append(LINKFLAGS=['-Wl,--threads'])
|
||||
env.Append(LINKFLAGS=target_opts)
|
||||
|
||||
Reference in New Issue
Block a user