introduces ios support? still needs metal
This commit is contained in:
@@ -3,6 +3,9 @@
|
||||
#include "unistd.h"
|
||||
#include "dlfcn.h"
|
||||
#include "libgen.h"
|
||||
#ifdef __APPLE__
|
||||
#include <mach-o/dyld.h>
|
||||
#endif
|
||||
|
||||
#define MAX_PATH 4096
|
||||
|
||||
@@ -16,26 +19,33 @@ typedef void (*EngineMainFn)(int argc, char** argv);
|
||||
EngineMainFn pEngineMain;
|
||||
|
||||
int main( int argc, char **argv ) {
|
||||
#ifdef __linux__
|
||||
readlink("/proc/self/exe",szLauncherPath, MAX_PATH);
|
||||
dirname(szLauncherPath);
|
||||
|
||||
snprintf(szEnginePath, MAX_PATH, "%s/libengine.so", szLauncherPath);
|
||||
snprintf(szTier0Path, MAX_PATH, "%s/libtier0.so", szLauncherPath);
|
||||
printf("%s\n",szEnginePath);
|
||||
printf("%s\n",szTier0Path);
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
uint32_t pathSize = sizeof(szLauncherPath);
|
||||
int pathResult = _NSGetExecutablePath(szLauncherPath, &pathSize);
|
||||
printf("%s\n",szLauncherPath);
|
||||
char *szLauncherPath2 = dirname(szLauncherPath);
|
||||
printf("%s\n",szLauncherPath2);
|
||||
snprintf(szEnginePath, MAX_PATH, "%s/libengine.dylib", szLauncherPath2);
|
||||
snprintf(szTier0Path, MAX_PATH, "%s/libtier0.dylib", szLauncherPath2);
|
||||
#endif
|
||||
|
||||
pTier0Lib = dlopen(szTier0Path, RTLD_NOW | RTLD_GLOBAL);
|
||||
if ( !pTier0Lib ) {
|
||||
printf("Failed to open libtier0.so\n");
|
||||
printf("Failed to open libtier0\n");
|
||||
printf("\t%s\n",dlerror());
|
||||
}
|
||||
pEngineLib = dlopen(szEnginePath, RTLD_NOW | RTLD_GLOBAL);
|
||||
if ( !pEngineLib ) {
|
||||
printf("Failed to open libengine.so\n");
|
||||
printf("Failed to open libengine\n");
|
||||
printf("\t%s\n",dlerror());
|
||||
}
|
||||
printf("\t%p\n",pTier0Lib);
|
||||
printf("\t%p\n",pEngineLib);
|
||||
pEngineMain = (EngineMainFn)dlsym(pEngineLib, "FunnyMain");
|
||||
if ( !pEngineMain ) {
|
||||
printf("Symbol not found: FunnyMain\n");
|
||||
|
||||
Reference in New Issue
Block a user