2015-05-24 22:22:51 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def is_active():
|
2016-10-30 18:44:57 +01:00
|
|
|
return True
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_name():
|
2016-10-30 18:44:57 +01:00
|
|
|
return "Haiku"
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def can_build():
|
2015-10-17 14:41:01 +02:00
|
|
|
|
2017-06-30 19:21:38 +02:00
|
|
|
if (os.name != "posix" or sys.platform == "darwin"):
|
2016-10-30 18:44:57 +01:00
|
|
|
return False
|
2015-10-17 14:41:01 +02:00
|
|
|
|
2016-10-30 18:44:57 +01:00
|
|
|
return True
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_opts():
|
2017-09-25 05:06:45 +02:00
|
|
|
from SCons.Variables import EnumVariable
|
2017-06-30 19:21:38 +02:00
|
|
|
|
2016-10-30 18:44:57 +01:00
|
|
|
return [
|
2017-09-25 05:06:45 +02:00
|
|
|
EnumVariable('debug_symbols', 'Add debug symbols to release version', 'yes', ('yes', 'no', 'full')),
|
2016-10-30 18:44:57 +01:00
|
|
|
]
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_flags():
|
2017-06-30 19:21:38 +02:00
|
|
|
|
2016-10-30 18:44:57 +01:00
|
|
|
return [
|
|
|
|
]
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-10-30 19:05:14 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def configure(env):
|
2016-10-30 18:44:57 +01:00
|
|
|
|
2017-06-30 19:21:38 +02:00
|
|
|
## Build type
|
2016-10-30 18:44:57 +01:00
|
|
|
|
2016-10-30 18:57:40 +01:00
|
|
|
if (env["target"] == "release"):
|
2017-09-13 19:32:24 +02:00
|
|
|
env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
|
|
|
|
if (env["debug_symbols"] == "yes"):
|
|
|
|
env.Prepend(CCFLAGS=['-g1'])
|
|
|
|
if (env["debug_symbols"] == "full"):
|
2017-06-30 19:21:38 +02:00
|
|
|
env.Prepend(CCFLAGS=['-g2'])
|
|
|
|
|
2016-10-30 18:57:40 +01:00
|
|
|
elif (env["target"] == "release_debug"):
|
2017-06-30 19:21:38 +02:00
|
|
|
env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
|
2017-09-13 19:32:24 +02:00
|
|
|
if (env["debug_symbols"] == "yes"):
|
|
|
|
env.Prepend(CCFLAGS=['-g1'])
|
|
|
|
if (env["debug_symbols"] == "full"):
|
|
|
|
env.Prepend(CCFLAGS=['-g2'])
|
2017-06-30 19:21:38 +02:00
|
|
|
|
2016-10-30 18:57:40 +01:00
|
|
|
elif (env["target"] == "debug"):
|
2017-09-13 19:32:24 +02:00
|
|
|
env.Prepend(CCFLAGS=['-g3', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
|
2017-06-30 19:21:38 +02:00
|
|
|
|
|
|
|
## Architecture
|
|
|
|
|
|
|
|
is64 = sys.maxsize > 2**32
|
|
|
|
if (env["bits"] == "default"):
|
|
|
|
env["bits"] = "64" if is64 else "32"
|
|
|
|
|
|
|
|
## Compiler configuration
|
2016-10-30 18:57:40 +01:00
|
|
|
|
2017-06-30 19:21:38 +02:00
|
|
|
env["CC"] = "gcc-x86"
|
|
|
|
env["CXX"] = "g++-x86"
|
|
|
|
|
|
|
|
## Flags
|
|
|
|
|
|
|
|
env.Append(CPPPATH=['#platform/haiku'])
|
2017-11-19 17:52:18 +01:00
|
|
|
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES_ENABLED', '-DGLES_OVER_GL'])
|
2017-06-30 19:21:38 +02:00
|
|
|
env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
|
2016-10-30 18:57:40 +01:00
|
|
|
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
|
|
|
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
|
|
|
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
|