Skip to content

Commit e57da8c

Browse files
author
Vano
committed
force register any method with GMETHOD(), better env paths
1 parent 70db7fc commit e57da8c

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cppscript.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def create_cppscript_target(env, sources, cppscript_env, *args, **kwargs):
1212
return env.CppScript(sources, cppscript_env, *args, **kwargs)
1313

1414
class CppScriptBuilder():
15-
def __init__(self, *args, **kwargs):
16-
self.builder = Builder(action=generate_header_scons, emitter=generate_header_emitter, *args, **kwargs)
15+
def __init__(self):
16+
self.builder = Builder(action=generate_header_scons, emitter=generate_header_emitter)
1717

1818
def __call__(self, scons_env, source, call_args, cwd = os.getcwd(), *args, **kwargs):
1919
env, *other = call_args
@@ -24,7 +24,7 @@ def __call__(self, scons_env, source, call_args, cwd = os.getcwd(), *args, **kwa
2424
'header_dir' : resolve_path(str(env['header_dir']), cwd),
2525
'gen_dir' : resolve_path(str(env['gen_dir']), cwd),
2626
'compile_defs' : {f'{i[0]}={i[1]}' if type(i) is tuple else str(i) for i in env.get('compile_defs', [])},
27-
'include_paths' : {resolve_path(i, cwd) for i in {cppscript_src, str(env['header_dir'])}.union({str(path) for path in env.get('include_paths', [])})},
27+
'include_paths' : {resolve_path(str(i), cwd) for i in [cppscript_src, env['header_dir']] + env.get('include_paths', [])},
2828
'auto_methods' : env['auto_methods']
2929
}
3030

@@ -281,8 +281,7 @@ def parse_class(parent, class_cursors):
281281
for cursor in parent.get_children():
282282
match cursor.kind:
283283
case CursorKind.CXX_METHOD:
284-
if cursor.access_specifier == AccessSpecifier.PUBLIC:
285-
class_cursors.append(cursor)
284+
class_cursors.append(cursor)
286285

287286
case CursorKind.FIELD_DECL:
288287
class_cursors.append(cursor)
@@ -489,7 +488,7 @@ def apply_macros(item, macros):
489488
case CursorKind.CXX_METHOD:
490489
is_virtual = is_virtual_method(item)
491490
properties = {}
492-
if process_macros(item, macros, properties, (is_virtual and item.spelling.startswith('_')) or not env['auto_methods']):
491+
if process_macros(item, macros, properties, (is_virtual and item.spelling.startswith('_')) or not env['auto_methods'] or item.access_specifier != AccessSpecifier.PUBLIC):
493492
properties |= { 'name' : item.spelling,
494493
'bind_name' : item.spelling,
495494
'return' : item.result_type.spelling,

0 commit comments

Comments
 (0)