From 599ed98f6cb956d5189ec4b4905dbc2a8a1b5d9a Mon Sep 17 00:00:00 2001 From: Fabio Alessandrelli Date: Thu, 16 May 2019 11:50:29 +0200 Subject: Small build system improvement --- SConstruct | 13 ++++++++++++- lib/godot-cpp/debug/.gitignore | 2 -- lib/godot-cpp/debug/x64/.gitignore | 2 ++ lib/godot-cpp/debug/x86/.gitignore | 2 ++ lib/godot-cpp/release/.gitignore | 2 -- lib/godot-cpp/release/x64/.gitignore | 2 ++ lib/godot-cpp/release/x86/.gitignore | 2 ++ 7 files changed, 20 insertions(+), 5 deletions(-) delete mode 100644 lib/godot-cpp/debug/.gitignore create mode 100644 lib/godot-cpp/debug/x64/.gitignore create mode 100644 lib/godot-cpp/debug/x86/.gitignore delete mode 100644 lib/godot-cpp/release/.gitignore create mode 100644 lib/godot-cpp/release/x64/.gitignore create mode 100644 lib/godot-cpp/release/x86/.gitignore diff --git a/SConstruct b/SConstruct index 31dda00..cc5807d 100644 --- a/SConstruct +++ b/SConstruct @@ -9,6 +9,13 @@ def add_sources(sources, dirpath, extension): sources.append(dirpath + '/' + f) +def get_arch_dir(name): + if name == '32': + return 'x86' + elif name == '64': + return 'x64' + return name + env = Environment() customs = ['custom.py'] opts = Variables(customs, ARGUMENTS) @@ -107,7 +114,7 @@ else: # Godot CPP bindings env.Append(CPPPATH=[godot_headers]) env.Append(CPPPATH=[godot_cpp_headers, godot_cpp_headers + '/core', godot_cpp_headers + '/gen']) -env.Append(LIBPATH=[godot_cpp_lib_dir + '/' + target]) +env.Append(LIBPATH=[godot_cpp_lib_dir + '/' + target + '/' + get_arch_dir(target_arch)]) env.Append(LIBS=['godot-cpp']) # WebRTC stuff @@ -156,6 +163,10 @@ sources = [] add_sources(sources, 'src/', 'cpp') add_sources(sources, 'src/net/', 'cpp') +# Suffix +suffix = '.%s.%s' % (target, target_arch) +env["SHOBJSUFFIX"] = suffix + env["SHOBJSUFFIX"] + # Make the shared library library = env.SharedLibrary(target=os.path.join(result_path, result_name), source=sources) Default(library) diff --git a/lib/godot-cpp/debug/.gitignore b/lib/godot-cpp/debug/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/lib/godot-cpp/debug/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/lib/godot-cpp/debug/x64/.gitignore b/lib/godot-cpp/debug/x64/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/lib/godot-cpp/debug/x64/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/lib/godot-cpp/debug/x86/.gitignore b/lib/godot-cpp/debug/x86/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/lib/godot-cpp/debug/x86/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/lib/godot-cpp/release/.gitignore b/lib/godot-cpp/release/.gitignore deleted file mode 100644 index d6b7ef3..0000000 --- a/lib/godot-cpp/release/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/lib/godot-cpp/release/x64/.gitignore b/lib/godot-cpp/release/x64/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/lib/godot-cpp/release/x64/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/lib/godot-cpp/release/x86/.gitignore b/lib/godot-cpp/release/x86/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/lib/godot-cpp/release/x86/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore -- cgit v1.2.3