godot-cpp/include/SConstruct

72 lines
2.1 KiB
Python
Raw Normal View History

#!python
2017-03-06 07:49:24 +00:00
import os
env = Environment()
2017-03-09 02:03:21 +00:00
2017-03-15 22:19:58 +00:00
if ARGUMENTS.get("use_llvm", "no") == "yes":
2017-03-09 02:03:21 +00:00
env["CXX"] = "clang++"
2017-03-06 07:49:24 +00:00
target = ARGUMENTS.get("target", "core")
2017-03-15 22:19:58 +00:00
platform = ARGUMENTS.get("p", "linux")
2017-03-06 07:49:24 +00:00
if (target == "core"):
2017-03-15 22:19:58 +00:00
if platform == "linux":
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14'])
2017-03-06 07:49:24 +00:00
env.Append(CPPPATH=['.', './godot'])
2017-03-15 22:19:58 +00:00
if platform == "windows":
env.Append(LIBS=['godot.windows.tools.64.lib'])
env.Append(CPPFLAGS=['-D_GD_CPP_CORE_API_IMPL'])
2017-03-06 07:49:24 +00:00
sources = [
'godot_cpp/core/Array.cpp',
'godot_cpp/core/Basis.cpp',
'godot_cpp/core/Color.cpp',
'godot_cpp/core/Dictionary.cpp',
'godot_cpp/core/Image.cpp',
'godot_cpp/core/InputEvent.cpp',
'godot_cpp/core/NodePath.cpp',
'godot_cpp/core/Plane.cpp',
'godot_cpp/core/PoolArrays.cpp',
'godot_cpp/core/Quat.cpp',
'godot_cpp/core/Rect2.cpp',
'godot_cpp/core/Rect3.cpp',
'godot_cpp/core/RID.cpp',
'godot_cpp/core/String.cpp',
'godot_cpp/core/Transform.cpp',
'godot_cpp/core/Transform2D.cpp',
'godot_cpp/core/Variant.cpp',
'godot_cpp/core/Vector2.cpp',
'godot_cpp/core/Vector3.cpp'
]
library = env.SharedLibrary(target='godot_cpp_core', source=sources)
Default(library)
2017-03-09 02:03:21 +00:00
elif target == "bindings":
2017-03-15 22:19:58 +00:00
if platform == "linux":
if env["CXX"] == "clang++":
env.Append(CCFLAGS = ['-Wno-writable-strings'])
else:
env.Append(CCFLAGS = ['-Wno-write-strings', '-Wno-return-local-addr'])
2017-03-09 02:03:21 +00:00
2017-03-15 22:19:58 +00:00
env.Append(CCFLAGS = ['-g','-O3', '-std=c++14'])
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN/\''])
2017-03-06 07:49:24 +00:00
env.Append(CPPPATH=['.', './godot', './godot_cpp'])
2017-03-18 14:23:28 +00:00
if platform == "windows":
env.Append(LIBS=['godot.windows.tools.64'])
env.Append(LIBS=['godot_cpp_core'])
2017-03-09 02:03:21 +00:00
env.Append(LIBPATH=["."])
2017-03-06 07:49:24 +00:00
2017-03-15 22:19:58 +00:00
env.Append(CPPFLAGS=['-D_GD_CPP_BINDING_IMPL'])
2017-03-06 07:49:24 +00:00
sources = [os.path.join("godot_cpp/impl/", f) for f in os.listdir("godot_cpp/impl/") if f.endswith('.cpp')]
library = env.SharedLibrary(target='godot_cpp_bindings', source=sources)
Default(library)