2015-05-24 22:22:51 +02:00
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def is_active():
|
2016-11-02 22:26:55 +01:00
|
|
|
return True
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_name():
|
2016-11-02 22:26:55 +01:00
|
|
|
return "Haiku"
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def can_build():
|
2016-11-02 22:26:55 +01:00
|
|
|
if (os.name != "posix"):
|
|
|
|
return False
|
2015-10-17 14:41:01 +02:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
if (sys.platform == "darwin"):
|
|
|
|
return False
|
2015-10-17 14:41:01 +02:00
|
|
|
|
2016-11-02 22:26:55 +01:00
|
|
|
return True
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_opts():
|
2016-11-02 22:26:55 +01:00
|
|
|
return [
|
2016-11-02 22:28:28 +01:00
|
|
|
('debug_release', 'Add debug symbols to release version', 'no')
|
2016-11-02 22:26:55 +01:00
|
|
|
]
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def get_flags():
|
2016-11-02 22:26:55 +01:00
|
|
|
return [
|
|
|
|
]
|
2015-05-24 22:22:51 +02:00
|
|
|
|
2016-11-02 22:29:36 +01:00
|
|
|
|
2015-05-24 22:22:51 +02:00
|
|
|
def configure(env):
|
2016-11-02 22:26:55 +01:00
|
|
|
is64 = sys.maxsize > 2**32
|
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
if (env["bits"] == "default"):
|
2016-11-02 22:26:55 +01:00
|
|
|
if (is64):
|
2016-11-02 22:28:28 +01:00
|
|
|
env["bits"] = "64"
|
2016-11-02 22:26:55 +01:00
|
|
|
else:
|
2016-11-02 22:28:28 +01:00
|
|
|
env["bits"] = "32"
|
2016-11-02 22:26:55 +01:00
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CPPPATH=['#platform/haiku'])
|
2016-11-02 22:26:55 +01:00
|
|
|
|
|
|
|
env["CC"] = "gcc-x86"
|
|
|
|
env["CXX"] = "g++-x86"
|
|
|
|
|
2016-11-02 22:28:28 +01:00
|
|
|
if (env["target"] == "release"):
|
|
|
|
if (env["debug_release"] == "yes"):
|
2016-11-02 22:26:55 +01:00
|
|
|
env.Append(CCFLAGS=['-g2'])
|
|
|
|
else:
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(CCFLAGS=['-O3', '-ffast-math'])
|
|
|
|
elif (env["target"] == "release_debug"):
|
|
|
|
env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
|
|
|
|
elif (env["target"] == "debug"):
|
2017-03-25 08:36:00 +01:00
|
|
|
env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
|
2016-11-02 22:28:28 +01:00
|
|
|
|
|
|
|
# env.Append(CCFLAGS=['-DFREETYPE_ENABLED'])
|
|
|
|
env.Append(CPPFLAGS=['-DPTHREAD_NO_RENAME']) # TODO: enable when we have pthread_setname_np
|
|
|
|
env.Append(CPPFLAGS=['-DOPENGL_ENABLED', '-DMEDIA_KIT_ENABLED'])
|
|
|
|
env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
|
|
|
|
env.Append(LIBS=['be', 'game', 'media', 'network', 'bnetapi', 'z', 'GL'])
|
2016-11-02 22:26:55 +01:00
|
|
|
|
|
|
|
import methods
|
2016-11-02 22:28:28 +01:00
|
|
|
env.Append(BUILDERS={'GLSL120': env.Builder(action=methods.build_legacygl_headers, suffix='glsl.h', src_suffix='.glsl')})
|
|
|
|
env.Append(BUILDERS={'GLSL': env.Builder(action=methods.build_glsl_headers, suffix='glsl.h', src_suffix='.glsl')})
|
|
|
|
env.Append(BUILDERS={'GLSL120GLES': env.Builder(action=methods.build_gles2_headers, suffix='glsl.h', src_suffix='.glsl')})
|