Merge pull request #5 from RameshRavone/master

Adding SConstruct file for kinematic_character
This commit is contained in:
Thomas Herzog
2017-07-22 22:38:37 +02:00
committed by GitHub
5 changed files with 54 additions and 1 deletions

View File

@@ -1,2 +1 @@
GDNative-demo.*
SConstruct

View File

@@ -0,0 +1,52 @@
#!python
import os
# To compile the module you need to run
# `scons p=linux` to compile for linux
# `scons p=windows` to compile for windows
# on linux you can optionally use `use_llvm=yes` to use clang instead of gcc
# Mac/Android will come soon as well. (help is appreciated :D)
# Set it with your own path
cpp_bindings = "cpp_bindings/include"
godot_headers = "godot_headers"
env = Environment()
if ARGUMENTS.get("use_llvm", "no") == "yes":
env["CXX"] = "clang++"
platform = ARGUMENTS.get("p", "linux")
bits = ARGUMENTS.get("bits", "64")
env.Append(CPPPATH=[godot_headers, cpp_bindings, cpp_bindings + '/godot_cpp', cpp_bindings+'/core', 'src'])
env.Append(LIBS=['godot_cpp_core', 'godot_cpp_bindings'])
env.Append(LIBPATH=[cpp_bindings, "lib", "cpp_bindings/bin"])
env.Append(CCFLAGS = ['-g','-O3'])
env.Append(CXXFLAGS = ['-std=c++14', '-Wwrite-strings'])
if platform == "linux":
env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN\''])
if platform == "windows":
env.Append(LIBS=['godot.windows.opt.tools.' + bits])
def add_source(sources, name):
sources.append("src/" + name)
def add_sources(sources, dir, extension):
for f in os.listdir("src/" + dir):
if f.endswith("." + extension):
sources.append("src/" + dir + "/" + f)
# # sources has all the paths to files that should be compiled
# # I usually have one init.cpp at the top of the source tree.
# sources = ["init.cpp"]
sources = Glob("src/*.cpp")
library = env.SharedLibrary(target=('lib/godot_char_control'), source=sources)
Default(library)

Submodule cpp/kinematic_character/Script/cpp_bindings added at a3bcda958e

Submodule cpp/kinematic_character/Script/godot_headers added at ee7a7df79d