mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
OSX: Add support for building with osxcross
This commit is contained in:
parent
abf6a0919b
commit
eb111c1d39
1 changed files with 22 additions and 9 deletions
|
|
@ -11,16 +11,16 @@ def get_name():
|
||||||
|
|
||||||
def can_build():
|
def can_build():
|
||||||
|
|
||||||
if (sys.platform != "darwin"):
|
if (sys.platform == "darwin" or ("OSXCROSS_ROOT" in os.environ)):
|
||||||
return False
|
return True
|
||||||
|
|
||||||
return True # osx enabled
|
return False
|
||||||
|
|
||||||
def get_opts():
|
def get_opts():
|
||||||
|
|
||||||
return [
|
return [
|
||||||
('force_64_bits','Force 64 bits binary','no'),
|
('force_64_bits','Force 64 bits binary','no'),
|
||||||
|
('osxcross_sdk', 'OSXCross SDK version', 'darwin14'),
|
||||||
]
|
]
|
||||||
|
|
||||||
def get_flags():
|
def get_flags():
|
||||||
|
|
@ -59,12 +59,25 @@ def configure(env):
|
||||||
env.Append(CPPPATH=['#tools/freetype'])
|
env.Append(CPPPATH=['#tools/freetype'])
|
||||||
env.Append(CPPPATH=['#tools/freetype/freetype/include'])
|
env.Append(CPPPATH=['#tools/freetype/freetype/include'])
|
||||||
|
|
||||||
|
if ("OSXCROSS_ROOT" not in os.environ):
|
||||||
|
# regular native build
|
||||||
if (env["bits"]=="64"):
|
if (env["bits"]=="64"):
|
||||||
env.Append(CCFLAGS=['-arch', 'x86_64'])
|
env.Append(CCFLAGS=['-arch', 'x86_64'])
|
||||||
env.Append(LINKFLAGS=['-arch', 'x86_64'])
|
env.Append(LINKFLAGS=['-arch', 'x86_64'])
|
||||||
else:
|
else:
|
||||||
env.Append(CCFLAGS=['-arch', 'i386'])
|
env.Append(CCFLAGS=['-arch', 'i386'])
|
||||||
env.Append(LINKFLAGS=['-arch', 'i386'])
|
env.Append(LINKFLAGS=['-arch', 'i386'])
|
||||||
|
else:
|
||||||
|
# osxcross build
|
||||||
|
root = os.environ.get("OSXCROSS_ROOT", 0)
|
||||||
|
arch = "i686" if env["bits"]=="32" else "x86_64"
|
||||||
|
basecmd = root + "/target/bin/" + arch + "-apple-" + env["osxcross_sdk"] + "-"
|
||||||
|
|
||||||
|
env['CC'] = basecmd + "cc"
|
||||||
|
env['CXX'] = basecmd + "c++"
|
||||||
|
env['AR'] = basecmd + "ar"
|
||||||
|
env['RANLIB'] = basecmd + "ranlib"
|
||||||
|
env['AS'] = basecmd + "as"
|
||||||
|
|
||||||
# env.Append(CPPPATH=['#platform/osx/include/freetype2', '#platform/osx/include'])
|
# env.Append(CPPPATH=['#platform/osx/include/freetype2', '#platform/osx/include'])
|
||||||
# env.Append(LIBPATH=['#platform/osx/lib'])
|
# env.Append(LIBPATH=['#platform/osx/lib'])
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue