diff --git a/Source/SConstruct b/Source/SConstruct index c056334..b849a34 100644 --- a/Source/SConstruct +++ b/Source/SConstruct @@ -1,5 +1,6 @@ #!python import os +import glob opts = Variables([], ARGUMENTS) @@ -14,16 +15,16 @@ opts.Add(EnumVariable('target', "Compilation target", 'debug', ['d', 'debug', 'r opts.Add(EnumVariable('platform', "Compilation platform", '', ['', 'windows', 'x11', 'linux', 'osx'])) opts.Add(EnumVariable('p', "Compilation target, alias for 'platform'", '', ['', 'windows', 'x11', 'linux', 'osx'])) opts.Add(BoolVariable('use_llvm', "Use the LLVM / Clang compiler", 'no')) -opts.Add(PathVariable('target_path', 'The path where the lib is installed.', ProjPath + '/Engine/gdnative_cpp/bin')) +opts.Add(PathVariable('target_path', 'The path where the lib is installed.', ProjPath + '/Engine/gdnative_cpp/bin/')) opts.Add(PathVariable('target_name', 'The library name.', 'libgdexample', PathVariable.PathAccept)) # Local dependency paths, adapt them to your setup -godot_headers_path = ProjPath + "/Engine/gdnative_cpp/godot_cpp/godot-headers/" -cpp_bindings_path = ProjPath + "/Engine/gdnative_cpp/godot_cpp/" +godot_headers_path = ProjPath + "/Engine/gdnative_cpp/godot-headers/" +cpp_bindings_path = ProjPath + "/Engine/gdnative_cpp/" cpp_library = "libgodot-cpp" -GDNative_Src = ProjPath + '/Engine/gdnative_cpp/godot_cpp/src/*.cpp' -Src = ProjPath + "/Source/*.cpp" +GDNative_Src = ProjPath + '/Engine/gdnative_cpp/src/' +Src = ProjPath + "/Source/" # only support 64 at this time.. bits = 64 @@ -99,16 +100,25 @@ else: cpp_library += '.' + str(bits) # make sure our binding library is properly includes -env.Append(CPPPATH=['.', godot_headers_path, cpp_bindings_path + 'include/', cpp_bindings_path + 'include/core/', cpp_bindings_path + 'include/gen/']) -env.Append(LIBPATH=[cpp_bindings_path + 'bin/']) +env.Append(CPPPATH=[ + '.', + godot_headers_path, + cpp_bindings_path + 'include/', + cpp_bindings_path + 'include/core/', + cpp_bindings_path + 'include/gen/']) + +env.Append(LIBPATH=[cpp_bindings_path + "/bin"]) + env.Append(LIBS=[cpp_library]) # tweak this if you want to use different folders, or more folders, to store your source code in. env.Append(CPPPATH=[GDNative_Src]) env.Append(CPPPATH=[Src]) -sources = Glob(GDNative_Src, Src) -test = "Sources: ".join(sources) -print(test); + +sources = Glob(GDNative_Src + '/*.cpp') + Glob(Src + '/*cpp') + +for thing in sources : + print(thing) library = env.SharedLibrary(target=env['target_path'] + env['target_name'] , source=sources) diff --git a/Source/gdexample.h b/Source/gdexample.h index a7a5d3d..48ef8a4 100644 --- a/Source/gdexample.h +++ b/Source/gdexample.h @@ -1,6 +1,6 @@ #pragma once -#include +#include #include namespace godot { diff --git a/Source/gdlibrary.h b/Source/gdlibrary.h index a6f13e1..9cbd644 100644 --- a/Source/gdlibrary.h +++ b/Source/gdlibrary.h @@ -1,3 +1,5 @@ +#pragma once + #include "gdexample.h" #define gd_export(Type_) \ diff --git a/Source/vc140.idb b/Source/vc140.idb index 78d3ebd..b547d80 100644 Binary files a/Source/vc140.idb and b/Source/vc140.idb differ diff --git a/Source/vc140.pdb b/Source/vc140.pdb index d84f375..c721dad 100644 Binary files a/Source/vc140.pdb and b/Source/vc140.pdb differ