diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/SConstruct | 17 | ||||
| -rw-r--r-- | include/godot_cpp/Godot.hpp | 34 | ||||
| -rw-r--r-- | include/godot_cpp/core/Color.hpp | 2 |
3 files changed, 25 insertions, 28 deletions
diff --git a/include/SConstruct b/include/SConstruct index 2287e94..c48e8c4 100644 --- a/include/SConstruct +++ b/include/SConstruct @@ -2,7 +2,9 @@ import os env = Environment() -env["CXX"] = "clang++" + +if ARGUMENTS.get("use_llvm", "yes") == "yes": + env["CXX"] = "clang++" target = ARGUMENTS.get("target", "core") @@ -35,13 +37,18 @@ if (target == "core"): library = env.SharedLibrary(target='godot_cpp_core', source=sources) Default(library) -elif target == "binding": - env.Append(CCFLAGS = ['-Wno-writable-strings']) +elif target == "bindings": + if env["CXX"] == "clang++": + env.Append(CCFLAGS = ['-Wno-writable-strings']) + else: + env.Append(CCFLAGS = ['-Wno-write-strings', '-Wno-return-local-addr']) + env.Append(CCFLAGS = ['-g','-O3', '-std=c++14']) env.Append(CPPPATH=['.', './godot', './godot_cpp']) - env.Append(RPATH=['.']) - env.Append(LINKFLAGS=['-Rgodot_cpp_core']) + env.Append(LINKFLAGS = ['-Wl,-R,\'$$ORIGIN/\'']) + env.Append(LIBS=['godot_cpp_core']) + env.Append(LIBPATH=["."]) sources = [os.path.join("godot_cpp/impl/", f) for f in os.listdir("godot_cpp/impl/") if f.endswith('.cpp')] diff --git a/include/godot_cpp/Godot.hpp b/include/godot_cpp/Godot.hpp index d07fa7b..cd569e2 100644 --- a/include/godot_cpp/Godot.hpp +++ b/include/godot_cpp/Godot.hpp @@ -20,16 +20,6 @@ namespace godot { -template<class A, class B> -A object_cast(B b) -{ - A *a = (A*) &b; - return *a; -} - - - - // instance and destroy funcs @@ -66,7 +56,7 @@ void register_class() template<class T, class R, class A0, class A1, class A2, class A3, class A4, R (T::*p)(A0, A1, A2, A3, A4)> struct WrappedMethod5 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -80,7 +70,7 @@ struct WrappedMethod5 { template<class T, class A0, class A1, class A2, class A3, class A4, void (T::*p)(A0, A1, A2, A3, A4)> struct WrappedMethod5<T, void, A0, A1, A2, A3, A4, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -93,7 +83,7 @@ struct WrappedMethod5<T, void, A0, A1, A2, A3, A4, p> { template<class T, class R, class A0, class A1, class A2, class A3, R (T::*p)(A0, A1, A2, A3)> struct WrappedMethod4 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -107,7 +97,7 @@ struct WrappedMethod4 { template<class T, class A0, class A1, class A2, class A3, void (T::*p)(A0, A1, A2, A3)> struct WrappedMethod4<T, void, A0, A1, A2, A3, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -121,7 +111,7 @@ struct WrappedMethod4<T, void, A0, A1, A2, A3, p> { template<class T, class R, class A0, class A1, class A2, R (T::*p)(A0, A1, A2)> struct WrappedMethod3 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -135,7 +125,7 @@ struct WrappedMethod3 { template<class T, class A0, class A1, class A2, void (T::*p)(A0, A1, A2)> struct WrappedMethod3<T, void, A0, A1, A2, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -148,7 +138,7 @@ struct WrappedMethod3<T, void, A0, A1, A2, p> { template<class T, class R, class A0, class A1, R (T::*p)(A0, A1)> struct WrappedMethod2 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -162,7 +152,7 @@ struct WrappedMethod2 { template<class T, class A0, class A1, void (T::*p)(A0, A1)> struct WrappedMethod2<T, void, A0, A1, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -175,7 +165,7 @@ struct WrappedMethod2<T, void, A0, A1, p> { template<class T, class R, class I, R (T::*p)(I)> struct WrappedMethod1 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -189,7 +179,7 @@ struct WrappedMethod1 { template <class T, class I, void (T::*p)(I)> struct WrappedMethod1<T, void, I, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -204,7 +194,7 @@ struct WrappedMethod1<T, void, I, p> { template<class T, class R, R (T::*p)()> struct WrappedMethod0 { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); @@ -217,7 +207,7 @@ struct WrappedMethod0 { template<class T, void (T::*p)()> struct WrappedMethod0<T, void, p> { - static godot_variant wrapped_method(godot_object *_, void *data, int num_args, godot_variant **args) + static godot_variant wrapped_method(godot_object *_, void *data, void *, int num_args, godot_variant **args) { godot_variant _variant; godot_variant_new_nil(&_variant); diff --git a/include/godot_cpp/core/Color.hpp b/include/godot_cpp/core/Color.hpp index d0f834d..528e674 100644 --- a/include/godot_cpp/core/Color.hpp +++ b/include/godot_cpp/core/Color.hpp @@ -14,7 +14,7 @@ struct Color { private: - static float _parse_col(const String& p_str, int p_ofs); + // static float _parse_col(const String& p_str, int p_ofs); public: union { |
