You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Introduce 'drivers/apple_embedded' abstract platform for code reuse
This commit is contained in:
@@ -115,9 +115,9 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
|
||||
libs_added.insert(library_path);
|
||||
add_shared_object(library_path, tags);
|
||||
|
||||
if (p_features.has("ios") && (library_path.ends_with(".a") || library_path.ends_with(".xcframework"))) {
|
||||
if (p_features.has("apple_embedded") && (library_path.ends_with(".a") || library_path.ends_with(".xcframework"))) {
|
||||
String additional_code = "extern void register_dynamic_symbol(char *name, void *address);\n"
|
||||
"extern void add_ios_init_callback(void (*cb)());\n"
|
||||
"extern void add_apple_embedded_platform_init_callback(void (*cb)());\n"
|
||||
"\n"
|
||||
"extern \"C\" void $ENTRY();\n"
|
||||
"void $ENTRY_init() {\n"
|
||||
@@ -125,15 +125,15 @@ void GDExtensionExportPlugin::_export_file(const String &p_path, const String &p
|
||||
"}\n"
|
||||
"struct $ENTRY_struct {\n"
|
||||
" $ENTRY_struct() {\n"
|
||||
" add_ios_init_callback($ENTRY_init);\n"
|
||||
" add_apple_embedded_platform_init_callback($ENTRY_init);\n"
|
||||
" }\n"
|
||||
"};\n"
|
||||
"$ENTRY_struct $ENTRY_struct_instance;\n\n";
|
||||
additional_code = additional_code.replace("$ENTRY", entry_symbol);
|
||||
add_ios_cpp_code(additional_code);
|
||||
add_apple_embedded_platform_cpp_code(additional_code);
|
||||
|
||||
String linker_flags = "-Wl,-U,_" + entry_symbol;
|
||||
add_ios_linker_flags(linker_flags);
|
||||
add_apple_embedded_platform_linker_flags(linker_flags);
|
||||
}
|
||||
|
||||
// Update found library info.
|
||||
|
||||
Reference in New Issue
Block a user