diff options
author | Thomas Herzog <thomas.herzog@mail.com> | 2017-10-08 21:16:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-08 21:16:27 +0200 |
commit | b9702991a199109b6dce1d6b54800b1e9235aa57 (patch) | |
tree | 40fffa6afad053e0a9d937e98b0b32958087b6fa | |
parent | 2b6f3bb4db81688133ad2d6af16f5411ada06d7a (diff) | |
parent | ce197990bc07ba6a357c1322304d59f566ba3497 (diff) |
Merge pull request #11946 from touilleMan/pluginscript-improve-wrapper-api
[GDnative] create generated include/gdnative_wrapper_code.gen.h
-rw-r--r-- | modules/gdnative/SCsub | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/modules/gdnative/SCsub b/modules/gdnative/SCsub index ff891e6562..6592d0ae1d 100644 --- a/modules/gdnative/SCsub +++ b/modules/gdnative/SCsub @@ -74,7 +74,6 @@ def build_gdnative_api_struct(target, source, env): from collections import OrderedDict with open(source[0].path, 'r') as fd: - # Keep the json ordered api = json.load(fd) header, source = target @@ -109,7 +108,7 @@ def _build_gdnative_wrapper_code(api): for funcdef in api['api']: args = ', '.join(['%s%s' % (_spaced(t), n) for t, n in funcdef['arguments']]) - out.append('%s %s(%s) {' % (_spaced(funcdef['return_type']), funcdef['name'], args)) + out.append('%s%s(%s) {' % (_spaced(funcdef['return_type']), funcdef['name'], args)) args = ', '.join(['%s' % n for t, n in funcdef['arguments']]) @@ -132,7 +131,6 @@ def _build_gdnative_wrapper_code(api): def build_gdnative_wrapper_code(target, source, env): import json with open(source[0].path, 'r') as fd: -#Keep the json ordered api = json.load(fd) wrapper_file = target[0] @@ -143,7 +141,7 @@ def build_gdnative_wrapper_code(target, source, env): if ARGUMENTS.get('gdnative_wrapper', False): #build wrapper code - gdn_env.Command('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', build_gdnative_wrapper_code) + gensource, = gdn_env.Command('gdnative_wrapper_code.gen.cpp', 'gdnative_api.json', build_gdnative_wrapper_code) gd_wrapper_env = env.Clone() gd_wrapper_env.Append(CPPPATH=['#modules/gdnative/include/']) @@ -151,4 +149,4 @@ if ARGUMENTS.get('gdnative_wrapper', False): # I think this doesn't work on MSVC yet... gd_wrapper_env.Append(CCFLAGS=['-fPIC']) - gd_wrapper_env.Library("#bin/gdnative_wrapper_code", ["#modules/gdnative/gdnative_wrapper_code.gen.cpp"]) + gd_wrapper_env.Library("#bin/gdnative_wrapper_code", [gensource]) |