mirror of
https://github.com/godotengine/gdnative-demos.git
synced 2026-01-01 05:48:13 +03:00
Merge pull request #5 from RameshRavone/master
Adding SConstruct file for kinematic_character
This commit is contained in:
1
cpp/kinematic_character/.gitignore
vendored
1
cpp/kinematic_character/.gitignore
vendored
@@ -1,2 +1 @@
|
||||
GDNative-demo.*
|
||||
SConstruct
|
||||
|
||||
Binary file not shown.
52
cpp/kinematic_character/Script/SConstruct
Normal file
52
cpp/kinematic_character/Script/SConstruct
Normal 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)
|
||||
1
cpp/kinematic_character/Script/cpp_bindings
Submodule
1
cpp/kinematic_character/Script/cpp_bindings
Submodule
Submodule cpp/kinematic_character/Script/cpp_bindings added at a3bcda958e
1
cpp/kinematic_character/Script/godot_headers
Submodule
1
cpp/kinematic_character/Script/godot_headers
Submodule
Submodule cpp/kinematic_character/Script/godot_headers added at ee7a7df79d
Reference in New Issue
Block a user