summaryrefslogtreecommitdiff
path: root/platform/haiku/detect.py
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-07-01 08:45:34 +0200
committerGitHub <noreply@github.com>2017-07-01 08:45:34 +0200
commit3d4aa94cf102adffdf2f167eb4c41ba48109fb48 (patch)
treeb77465a18fa9c184e7cd7185d29ac57549c3c267 /platform/haiku/detect.py
parent2a3e00c8c7e6f997b12864755a3df3b9bd3cca05 (diff)
parente91a267a7c9e1e82118ab4f98ed60908c34de115 (diff)
Merge pull request #9455 from akien-mga/buildsystem-fixes
Buildsystem: Improve detect.py readability and fix issues
Diffstat (limited to 'platform/haiku/detect.py')
-rw-r--r--platform/haiku/detect.py51
1 files changed, 26 insertions, 25 deletions
diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py
index 54e227cd19..c0e003a3d2 100644
--- a/platform/haiku/detect.py
+++ b/platform/haiku/detect.py
@@ -11,57 +11,58 @@ def get_name():
def can_build():
- if (os.name != "posix"):
- return False
- if (sys.platform == "darwin"):
+ if (os.name != "posix" or sys.platform == "darwin"):
return False
return True
def get_opts():
+
return [
('debug_release', 'Add debug symbols to release version', 'no')
]
def get_flags():
+
return [
]
def configure(env):
- is64 = sys.maxsize > 2**32
-
- if (env["bits"] == "default"):
- if (is64):
- env["bits"] = "64"
- else:
- env["bits"] = "32"
-
- env.Append(CPPPATH=['#platform/haiku'])
- env["CC"] = "gcc-x86"
- env["CXX"] = "g++-x86"
+ ## Build type
if (env["target"] == "release"):
if (env["debug_release"] == "yes"):
- env.Append(CCFLAGS=['-g2'])
+ env.Prepend(CCFLAGS=['-g2'])
else:
- env.Append(CCFLAGS=['-O3', '-ffast-math'])
+ env.Prepend(CCFLAGS=['-O3', '-ffast-math'])
+
elif (env["target"] == "release_debug"):
- env.Append(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+ env.Prepend(CCFLAGS=['-O2', '-ffast-math', '-DDEBUG_ENABLED'])
+
elif (env["target"] == "debug"):
- env.Append(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+ env.Prepend(CCFLAGS=['-g2', '-DDEBUG_ENABLED', '-DDEBUG_MEMORY_ENABLED'])
+
+ ## Architecture
+
+ is64 = sys.maxsize > 2**32
+ if (env["bits"] == "default"):
+ env["bits"] = "64" if is64 else "32"
+
+ ## Compiler configuration
+ env["CC"] = "gcc-x86"
+ env["CXX"] = "g++-x86"
+
+ ## Flags
+
+ env.Append(CPPPATH=['#platform/haiku'])
+ env.Append(CPPFLAGS=['-DUNIX_ENABLED', '-DOPENGL_ENABLED', '-DGLES2_ENABLED', '-DGLES_OVER_GL'])
+ env.Append(CPPFLAGS=['-DMEDIA_KIT_ENABLED'])
# 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'])
-
- import methods
- 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')})