playing with em/pnacl platforms
authorRejean Loyer <redj@ecere.com>
Thu, 16 Oct 2014 05:23:26 +0000 (01:23 -0400)
committerRejean Loyer <redj@ecere.com>
Mon, 16 Mar 2015 05:31:56 +0000 (01:31 -0400)
crossplatform.mk
ecere/src/com/instance.c
ecere/src/com/instance.ec
ide/src/project/Project.ec

index 633d71b..8f829d6 100644 (file)
@@ -80,6 +80,12 @@ else
 ifeq ($(TARGET_PLATFORM),apple)
    OSX_TARGET := defined
 else
+ifeq ($(TARGET_PLATFORM),emscripten)
+   EMSCRIPTEN_TARGET := defined
+else
+ifeq ($(TARGET_PLATFORM),pnacl)
+   PNACL_TARGET := defined
+else
 #ifeq ($(TARGET_PLATFORM),bsd)
 #   BSD_TARGET := defined
 #else
@@ -87,6 +93,8 @@ else
 #endif
 endif
 endif
+endif
+endif
 
 # CROSS_TARGET
 ifneq ($(TARGET_PLATFORM),$(HOST_PLATFORM))
index 7432ffc..fdc1e08 100644 (file)
@@ -137,13 +137,15 @@ char * __ecereNameSpace__ecere__sys__GetExtension(const char * string, char * ou
 
 extern struct __ecereNameSpace__ecere__com__Instance * __thisModule;
 
-typedef enum { unknown, win32, tux, apple } Platform;
+typedef enum { unknown, win32, tux, apple, emscripten, pnacl } Platform;
 
 #if defined(__WIN32__) && !defined(__EMSCRIPTEN__)
 Platform runtimePlatform = win32;
 #elif defined(__APPLE__)
 Platform runtimePlatform = apple;
-#else //if defined(__linux__)
+#elif defined(__EMSCRIPTEN__) // (EMSCRIPTEN)
+Platform runtimePlatform = emscripten;
+#else //elif defined(__linux__)
 Platform runtimePlatform = tux;
 /*#else
 Platform runtimePlatform = unknown;    // 'linux' is used as a catch all UNIX platform for now
index 36f5531..72fdff0 100644 (file)
@@ -6698,13 +6698,13 @@ static void FreeTemplatesDerivatives(Class base)
    }
 }
 
-static const char * platformNames[Platform] = { "", "win32", "linux", "apple" }; // how to have this be accessible outside of dll/lib
+static const char * platformNames[Platform] = { "", "win32", "linux", "apple", "emscripten", "pnacl" }; // how to have this be accessible outside of dll/lib
 static const Platform firstPlatform = win32;
-static const Platform lastPlatform = apple;
+static const Platform lastPlatform = pnacl;
 
 public enum Platform
 {
-   unknown, win32, tux, apple;
+   unknown, win32, tux, apple, emscripten, pnacl;
 
    property const char *
    {
index 613b298..3c4ec44 100644 (file)
@@ -750,10 +750,12 @@ define platformTargetType =
 
 const char * PlatformToMakefileTargetVariable(Platform platform)
 {
-   return platform == win32 ? "WINDOWS_TARGET" :
-          platform == tux   ? "LINUX_TARGET"   :
-          platform == apple ? "OSX_TARGET"     :
-                              "ERROR_BAD_TARGET";
+   return platform == win32      ? "WINDOWS_TARGET" :
+          platform == tux        ? "LINUX_TARGET" :
+          platform == apple      ? "OSX_TARGET" :
+          platform == emscripten ? "EMSCRIPTEN_TARGET" :
+          platform == pnacl      ? "PNACL_TARGET" :
+                                   "ERROR_BAD_TARGET";
 }
 
 const char * TargetTypeToMakefileVariable(TargetTypes targetType)