Browse Source

Building Web from Jakefile

Josh Engebretson 10 years ago
parent
commit
b1277c1309
1 changed files with 29 additions and 0 deletions
  1. 29 0
      Jakefile

+ 29 - 0
Jakefile

@@ -184,6 +184,35 @@ namespace('build', function() {
   });
   });
 
 
 
 
+  task('web', ['macosx_atomictool'], {async:true}, function() {
+
+    if (!fs.existsSync(webBuildFolder)) {
+      jake.mkdirP(webBuildFolder);
+    }
+
+    process.chdir(webBuildFolder);
+
+    var cmds = [
+      atomictool + " bind " + jakeRoot + " Script/Packages/Atomic/ WEB",
+      atomictool + " bind " + jakeRoot + " Script/Packages/AtomicPlayer/ WEB",
+      "cmake -DEMSCRIPTEN=1 -DATOMIC_BUILD_2D=1 -DCMAKE_TOOLCHAIN_FILE=" + jakeRoot + "/CMake/Toolchains/emscripten.toolchain.cmake -DCMAKE_BUILD_TYPE=Release ../../",
+      "make -j4",
+      "cd ./Source/AtomicPlayer/Application && mv ./AtomicPlayer ./AtomicPlayer.bc && " +
+      // -s ERROR_ON_UNDEFINED_SYMBOLS=1 (disabled for pthread errors currently on incoming)
+      "emcc -O3 -s USE_PTHREADS=0 -s ASM_JS=1 -s VERBOSE=0 -s USE_SDL=2 -s TOTAL_MEMORY=134217728 -s AGGRESSIVE_VARIABLE_ELIMINATION=1 -s NO_EXIT_RUNTIME=1 ./AtomicPlayer.bc -o  ./AtomicPlayer.html"
+
+    ]
+
+    jake.exec(cmds, function() {
+      console.log("Built Web Player");
+      complete();
+    }, {
+      printStdout: true
+    });
+
+  });
+
+
 }); // end build namespace
 }); // end build namespace