|
|
@@ -7,16 +7,49 @@ bool build_musializer(void)
|
|
|
Nob_Cmd cmd = {0};
|
|
|
Nob_Procs procs = {0};
|
|
|
|
|
|
-#ifdef MUSIALIZER_HOTRELOAD
|
|
|
- nob_log(NOB_ERROR, "TODO: hotreloading is not supported on %s yet", NOB_ARRAY_GET(target_names, config.target));
|
|
|
- nob_return_defer(false);
|
|
|
-#else
|
|
|
cmd.count = 0;
|
|
|
nob_cmd_append(&cmd, "rc");
|
|
|
nob_cmd_append(&cmd, "/fo", "./build/musializer.res");
|
|
|
nob_cmd_append(&cmd, "./src/musializer.rc");
|
|
|
// NOTE: Do not change the order of commandline arguments to rc. Their argparser is weird.
|
|
|
if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
|
|
|
+#ifdef MUSIALIZER_HOTRELOAD
|
|
|
+ procs.count = 0;
|
|
|
+ cmd.count = 0;
|
|
|
+ nob_cmd_append(&cmd, "cl.exe");
|
|
|
+ nob_cmd_append(&cmd, "/LD");
|
|
|
+ nob_cmd_append(&cmd, "/Fobuild\\", "/Fe./build/libplug.dll");
|
|
|
+ nob_cmd_append(&cmd, "/I", "./build/");
|
|
|
+ nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/");
|
|
|
+ nob_cmd_append(&cmd,
|
|
|
+ "src/plug.c",
|
|
|
+ "src/ffmpeg_windows.c");
|
|
|
+ nob_cmd_append(&cmd,
|
|
|
+ "/link",
|
|
|
+ nob_temp_sprintf("/LIBPATH:build/raylib/%s", MUSIALIZER_TARGET_NAME),
|
|
|
+ "raylib.lib");
|
|
|
+ nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib");
|
|
|
+ nob_da_append(&procs, nob_cmd_run_async(cmd));
|
|
|
+
|
|
|
+ cmd.count = 0;
|
|
|
+ nob_cmd_append(&cmd, "cl.exe");
|
|
|
+ nob_cmd_append(&cmd, "/I", "./build/");
|
|
|
+ nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/");
|
|
|
+ nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
|
|
|
+ nob_cmd_append(&cmd,
|
|
|
+ "./src/musializer.c",
|
|
|
+ "./src/hotreload_windows.c",
|
|
|
+ );
|
|
|
+ nob_cmd_append(&cmd,
|
|
|
+ "/link",
|
|
|
+ "/SUBSYSTEM:WINDOWS",
|
|
|
+ "/entry:mainCRTStartup",
|
|
|
+ nob_temp_sprintf("/LIBPATH:build/raylib/%s", MUSIALIZER_TARGET_NAME),
|
|
|
+ "raylib.lib");
|
|
|
+ nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib", "./build/musializer.res");
|
|
|
+ nob_da_append(&procs, nob_cmd_run_async(cmd));
|
|
|
+ if (!nob_procs_wait(procs)) nob_return_defer(false);
|
|
|
+#else
|
|
|
cmd.count = 0;
|
|
|
nob_cmd_append(&cmd, "cl.exe");
|
|
|
nob_cmd_append(&cmd, "/I", "./build/");
|
|
|
@@ -25,9 +58,7 @@ bool build_musializer(void)
|
|
|
nob_cmd_append(&cmd,
|
|
|
"./src/musializer.c",
|
|
|
"./src/plug.c",
|
|
|
- "./src/ffmpeg_windows.c"
|
|
|
- // TODO: building resource file is not implemented for TARGET_WIN64_MSVC
|
|
|
- );
|
|
|
+ "./src/ffmpeg_windows.c");
|
|
|
nob_cmd_append(&cmd,
|
|
|
"/link",
|
|
|
"/SUBSYSTEM:WINDOWS",
|
|
|
@@ -73,6 +104,9 @@ bool build_raylib(void)
|
|
|
if (nob_needs_rebuild(output_path, &input_path, 1)) {
|
|
|
cmd.count = 0;
|
|
|
nob_cmd_append(&cmd, "cl.exe", "/DPLATFORM_DESKTOP", "/DSUPPORT_FILEFORMAT_FLAC=1");
|
|
|
+ #ifdef MUSIALIZER_HOTRELOAD
|
|
|
+ nob_cmd_append(&cmd, "/DBUILD_LIBTYPE_SHARED");
|
|
|
+ #endif
|
|
|
nob_cmd_append(&cmd, "/I", "./raylib/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
|
|
|
nob_cmd_append(&cmd, "/c", input_path);
|
|
|
nob_cmd_append(&cmd, nob_temp_sprintf("/Fo%s", output_path));
|
|
|
@@ -83,7 +117,6 @@ bool build_raylib(void)
|
|
|
cmd.count = 0;
|
|
|
|
|
|
if (!nob_procs_wait(procs)) nob_return_defer(false);
|
|
|
-
|
|
|
#ifndef MUSIALIZER_HOTRELOAD
|
|
|
const char *libraylib_path = nob_temp_sprintf("%s/raylib.lib", build_path);
|
|
|
if (nob_needs_rebuild(libraylib_path, object_files.items, object_files.count)) {
|
|
|
@@ -96,10 +129,19 @@ bool build_raylib(void)
|
|
|
if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
|
|
|
}
|
|
|
#else
|
|
|
- nob_log(NOB_WARNING, "TODO: dynamic raylib for %s is not supported yet", NOB_ARRAY_GET(target_names, config.target));
|
|
|
- nob_return_defer(false);
|
|
|
+ if (nob_needs_rebuild("./build/raylib.dll", object_files.items, object_files.count)) {
|
|
|
+ nob_cmd_append(&cmd, "link.exe", "/DLL");
|
|
|
+ for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
|
|
|
+ const char *input_path = nob_temp_sprintf("%s/%s.obj", build_path, raylib_modules[i]);
|
|
|
+ nob_cmd_append(&cmd, input_path);
|
|
|
+ }
|
|
|
+ nob_cmd_append(&cmd, "Winmm.lib", "gdi32.lib", "User32.lib", "Shell32.lib");
|
|
|
+ nob_cmd_append(&cmd, nob_temp_sprintf("/IMPLIB:%s/raylib.lib", build_path));
|
|
|
+ nob_cmd_append(&cmd, "/OUT:./build/raylib.dll");
|
|
|
+ if (!nob_cmd_run_sync(cmd)) nob_return_defer(false);
|
|
|
+ }
|
|
|
#endif // MUSIALIZER_HOTRELOAD
|
|
|
-
|
|
|
+
|
|
|
defer:
|
|
|
nob_cmd_free(cmd);
|
|
|
nob_da_free(object_files);
|
|
|
@@ -115,4 +157,4 @@ bool build_dist(void)
|
|
|
nob_log(NOB_ERROR, "TODO: Creating distro for MSVC build is not implemented yet");
|
|
|
return false;
|
|
|
#endif // MUSIALIZER_HOTRELOAD
|
|
|
-}
|
|
|
+}
|