|
|
@@ -7,6 +7,7 @@ using dylib_entry_t = const char* (*)(void*, const char*);
|
|
|
#if PK_ENABLE_OS
|
|
|
|
|
|
#if PK_SUPPORT_DYLIB == 1
|
|
|
+// win32
|
|
|
static dylib_entry_t load_dylib(const char* path){
|
|
|
std::error_code ec;
|
|
|
auto p = std::filesystem::absolute(path, ec);
|
|
|
@@ -32,7 +33,7 @@ static dylib_entry_t load_dylib(const char* path){
|
|
|
return (dylib_entry_t)GetProcAddress(handle, "platform_module__init__");
|
|
|
}
|
|
|
#elif PK_SUPPORT_DYLIB == 2
|
|
|
-
|
|
|
+// linux/darwin
|
|
|
static dylib_entry_t load_dylib(const char* path){
|
|
|
std::error_code ec;
|
|
|
auto p = std::filesystem::absolute(path, ec);
|
|
|
@@ -41,6 +42,15 @@ static dylib_entry_t load_dylib(const char* path){
|
|
|
if(!handle) return nullptr;
|
|
|
return (dylib_entry_t)dlsym(handle, "platform_module__init__");
|
|
|
}
|
|
|
+
|
|
|
+#elif PK_SUPPORT_DYLIB == 3
|
|
|
+// android
|
|
|
+static dylib_entry_t load_dylib(const char* path){
|
|
|
+ void* handle = dlopen(path, RTLD_LAZY);
|
|
|
+ if(!handle) return nullptr;
|
|
|
+ return (dylib_entry_t)dlsym(handle, "platform_module__init__");
|
|
|
+}
|
|
|
+
|
|
|
#else
|
|
|
static dylib_entry_t load_dylib(const char* path){
|
|
|
return nullptr;
|