This repository was archived by the owner on Feb 13, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_for_web.bat
More file actions
39 lines (30 loc) · 1.76 KB
/
build_for_web.bat
File metadata and controls
39 lines (30 loc) · 1.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
@echo off
REM Turn off command echoing for cleaner output
pushd %~dp0
REM Change the current directory to the script's directory
mkdir build-emc
REM Create a directory named 'build-emc' if it doesn't exist
@REM xcopy /E /I /Y ".\assets\" ".\build-emc\assets\"
REM Copy the contents of the 'assets' directory to 'build-emc/assets/'
REM /E: Copy directories and subdirectories, including empty ones
REM /I: Assume the destination is a directory if more than one file is being copied
REM /Y: Suppress the prompt to confirm overwriting files
cd build-emc
REM Change the current directory to 'build-emc'
@REM @REM use the below if you have set up emscripten_set_main_loop()
@REM call emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
@REM @REM else use the below if you have not set up emscripten_set_main_loop()
@REM @REM call emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html" -DASYNCIFY=1
IF "%1"=="async" (
echo using asyncify
call emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html" -DASYNCIFY=1
) ELSE (
call emcmake cmake .. -DPLATFORM=Web -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3" -DCMAKE_EXECUTABLE_SUFFIX=".html"
)
REM Call 'emcmake cmake' to configure the project for Emscripten/Web
REM -DPLATFORM=Web: Set the platform to Web
REM -DCMAKE_BUILD_TYPE=Release: Build in Release mode
REM -DCMAKE_EXE_LINKER_FLAGS="-s USE_GLFW=3": Link GLFW library
REM -DCMAKE_EXECUTABLE_SUFFIX=".html": Set the executable suffix to .html
call emmake make
REM Call 'emmake make' to build the project using Emscripten