Skip to content

Commit a67b494

Browse files
committed
Update rexm.c
1 parent 3b16a72 commit a67b494

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

tools/rexm/rexm.c

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,15 @@ int main(int argc, char *argv[])
570570
// Compile to: raylib.com/examples/<category>/<category>_example_name.wasm
571571
// Compile to: raylib.com/examples/<category>/<category>_example_name.js
572572
//------------------------------------------------------------------------------------------------
573+
// WARNING 1: EMSDK_PATH must be set to proper location when calling from GitHub Actions
574+
// WARNING 2: raylib.a and raylib.web.a must be available when compiling locally
575+
#if defined(_WIN32)
573576
//putenv("RAYLIB_DIR=C:\\GitHub\\raylib");
574-
//putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
575-
// WARNING: EMSDK_PATH must be set to proper location when calling from GitHub Actions
576-
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
577-
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exCategory, exName));
578-
577+
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
578+
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
579+
#else
580+
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
581+
#endif
579582
// Update generated .html metadata
580583
char exHtmlPath[512] = { 0 };
581584
strcpy(exHtmlPath, TextFormat("%s/%s/%s.html", exBasePath, exCategory, exName)); // WARNING: Cache path for saving
@@ -1025,8 +1028,12 @@ int main(int argc, char *argv[])
10251028
((exInfo->status & VALID_MISSING_WEB_OUTPUT) || (exInfo->status & VALID_MISSING_WEB_METADATA)))
10261029
{
10271030
// Build example for PLATFORM_WEB
1028-
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
1029-
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
1031+
#if defined(_WIN32)
1032+
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
1033+
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
1034+
#else
1035+
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exInfo->category, exInfo->name));
1036+
#endif
10301037

10311038
// Update generated .html metadata
10321039
char exHtmlPath[512] = { 0 };
@@ -1201,15 +1208,23 @@ int main(int argc, char *argv[])
12011208
if (strcmp(exCategory, "others") != 0) // Skipping "others" category
12021209
{
12031210
// Build example for PLATFORM_DESKTOP
1211+
#if defined(_WIN32)
12041212
//putenv(TextFormat("RAYLIB_DIR=%s\\..", exBasePath));
1205-
//putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
1213+
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
12061214
//putenv("MAKE=mingw32-make");
12071215
//ChangeDirectory(exBasePath);
1216+
system(TextFormat("mingw32-make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
1217+
#else
12081218
system(TextFormat("make -C %s %s/%s PLATFORM=PLATFORM_DESKTOP -B", exBasePath, exCategory, exName));
1219+
#endif
12091220

12101221
// Build example for PLATFORM_WEB
1211-
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
1212-
//system(TextFormat("%s/build_example_web.bat %s/%s", exBasePath, exInfo->category, exInfo->name));
1222+
#if defined(_WIN32)
1223+
putenv("PATH=%PATH%;C:\\raylib\\w64devkit\\bin");
1224+
system(TextFormat("mingw32-make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
1225+
#else
1226+
system(TextFormat("make -C %s -f Makefile.Web %s/%s PLATFORM=PLATFORM_WEB -B", exBasePath, exCategory, exName));
1227+
#endif
12131228

12141229
// Update generated .html metadata
12151230
char exHtmlPath[512] = { 0 };

0 commit comments

Comments
 (0)