From 858d600a16b16de73f343a5f82ce3b38aee1fd45 Mon Sep 17 00:00:00 2001 From: halx99 Date: Mon, 2 Nov 2020 16:37:18 +0800 Subject: [PATCH] tolua mutli search paths support --- tools/bindings-generator/generator.py | 5 +++-- tools/tolua/cocos2dx.ini | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/bindings-generator/generator.py b/tools/bindings-generator/generator.py index 10e8393e87..4b36bd1393 100644 --- a/tools/bindings-generator/generator.py +++ b/tools/bindings-generator/generator.py @@ -1268,7 +1268,8 @@ class Generator(object): def __init__(self, opts): self.index = cindex.Index.create() self.outdir = opts['outdir'] - self.search_path = opts['search_path'] + print('search_paths=' + opts['search_paths']) + self.search_paths = opts['search_paths'].split(';') self.prefix = opts['prefix'] self.headers = opts['headers'].split(' ') self.classes = opts['classes'] @@ -1855,7 +1856,7 @@ def main(): 'clang_args': (config.get(s, 'extra_arguments', 0, dict(userconfig.items('DEFAULT'))) or "").split(" "), 'target': os.path.join(workingdir, "targets", t), 'outdir': outdir, - 'search_path': os.path.abspath(os.path.join(userconfig.get('DEFAULT', 'cocosdir'), 'cocos')), + 'search_paths': os.path.abspath(os.path.join(userconfig.get('DEFAULT', 'cocosdir'), 'cocos')) + ";" + os.path.abspath(os.path.join(userconfig.get('DEFAULT', 'cocosdir'), 'extensions')), 'remove_prefix': config.get(s, 'remove_prefix'), 'target_ns': config.get(s, 'target_namespace'), 'cpp_ns': config.get(s, 'cpp_namespace').split(' ') if config.has_option(s, 'cpp_namespace') else None, diff --git a/tools/tolua/cocos2dx.ini b/tools/tolua/cocos2dx.ini index bf91f8788d..d7b3bd5634 100644 --- a/tools/tolua/cocos2dx.ini +++ b/tools/tolua/cocos2dx.ini @@ -23,7 +23,7 @@ cxxgenerator_headers = extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s %(extra_flags)s # what headers to parse -headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/base/CCAsyncTaskPool.h %(cocosdir)s/extensions/scripting/lua-bindings/manual/CCComponentLua.h %(cocosdir)s/cocos/renderer/CCRenderer.h %(cocosdir)s/cocos/renderer/CCPipelineDescriptor.h +headers = %(cocosdir)s/cocos/cocos2d.h %(cocosdir)s/cocos/2d/CCProtectedNode.h %(cocosdir)s/cocos/base/CCAsyncTaskPool.h %(cocosdir)s/extensions/scripting/lua-bindings/manual/CCComponentLua.h %(cocosdir)s/cocos/renderer/CCRenderer.h %(cocosdir)s/cocos/renderer/CCPipelineDescriptor.h %(cocosdir)s/cocos/renderer/backend/RenderTarget.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^Menu*$". @@ -107,7 +107,7 @@ skip = Node::[setGLServerState description getUserObject .*UserData getGLServerS Camera::[getEyeXYZ getCenterXYZ getUpXYZ], ccFontDefinition::[*], Ref::[autorelease isEqual acceptVisitor update], - UserDefault::[getInstance (s|g)etDataForKey], + UserDefault::[getInstance (s|g)etDataForKey encrypt], GLView::[setTouchDelegate getAllTouches], GLViewImpl::[end swapBuffers], NewTextureAtlas::[*],