Преглед изворни кода

Introduce RAYLIB_SRC_FOLDER

rexim пре 6 месеци
родитељ
комит
d14b31648c

+ 1 - 0
src_build/configurer.c

@@ -1,5 +1,6 @@
 #define RAYLIB_VERSION "5.5"
 #define CONFIG_PATH "./build/config.h"
+#define RAYLIB_SRC_FOLDER "./thirdparty/raylib-" RAYLIB_VERSION "/src/"
 
 typedef struct {
     const char *macro;

+ 5 - 5
src_build/nob_linux.c

@@ -11,7 +11,7 @@ bool build_musializer(void)
     // Like `clang` for instance
     nob_cmd_append(&cmd, "cc",
         "-Wall", "-Wextra", "-ggdb",
-        "-I.", "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
+        "-I.", "-I"RAYLIB_SRC_FOLDER,
         "-fPIC", "-shared",
         "-o", "./build/libplug.so",
         "./src/plug.c", "./src/ffmpeg_posix.c", "./thirdparty/tinyfiledialogs.c",
@@ -22,7 +22,7 @@ bool build_musializer(void)
 
     nob_cmd_append(&cmd, "cc",
         "-Wall", "-Wextra", "-ggdb",
-        "-I.", "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
+        "-I.", "-I"RAYLIB_SRC_FOLDER,
         "-o", "./build/musializer",
         "./src/musializer.c", "./src/hotreload_posix.c",
         "-Wl,-rpath=./build/",
@@ -40,7 +40,7 @@ bool build_musializer(void)
     nob_cmd_append(&cmd, "cc",
         "-Wall", "-Wextra", "-ggdb",
         "-I.",
-        "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
+        "-I"RAYLIB_SRC_FOLDER,
         "-o", "./build/musializer",
         "./src/plug.c", "./src/ffmpeg_posix.c", "./src/musializer.c", "./thirdparty/tinyfiledialogs.c",
         nob_temp_sprintf("-L./build/raylib/%s", MUSIALIZER_TARGET_NAME), "-l:libraylib.a",
@@ -74,7 +74,7 @@ bool build_raylib(void)
     }
 
     for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
-        const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
+        const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
         const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
         output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
 
@@ -83,7 +83,7 @@ bool build_raylib(void)
         if (nob_needs_rebuild(output_path, &input_path, 1)) {
             nob_cmd_append(&cmd, "cc",
                 "-ggdb", "-DPLATFORM_DESKTOP", "-D_GLFW_X11", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1",
-                "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include",
+                "-I"RAYLIB_SRC_FOLDER"external/glfw/include",
                 "-c", input_path,
                 "-o", output_path);
             nob_da_append(&procs, nob_cmd_run_async_and_reset(&cmd));

+ 5 - 5
src_build/nob_macos.c

@@ -16,7 +16,7 @@ bool build_musializer(void)
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
         nob_cmd_append(&cmd, "-I.");
-        nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+        nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
         nob_cmd_append(&cmd, "-fPIC", "-shared");
         nob_cmd_append(&cmd, "-o", "./build/libplug.dylib");
         nob_cmd_append(&cmd,
@@ -31,7 +31,7 @@ bool build_musializer(void)
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
         nob_cmd_append(&cmd, "-I.");
-        nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+        nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,
             "./src/musializer.c",
@@ -49,7 +49,7 @@ bool build_musializer(void)
         nob_cmd_append(&cmd, "clang");
         nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
         nob_cmd_append(&cmd, "-I.");
-        nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+        nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,
             "./src/plug.c",
@@ -93,7 +93,7 @@ bool build_raylib(void)
     }
 
     for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
-        const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
+        const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
         const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
 
         nob_da_append(&object_files, output_path);
@@ -102,7 +102,7 @@ bool build_raylib(void)
             cmd.count = 0;
             nob_cmd_append(&cmd, "clang");
             nob_cmd_append(&cmd, "-g", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
-            nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
+            nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
             nob_cmd_append(&cmd, "-Iexternal/glfw/deps/ming");
             nob_cmd_append(&cmd, "-DGRAPHICS_API_OPENGL_33");
             if(strcmp(raylib_modules[i], "rglfw") == 0) {

+ 5 - 5
src_build/nob_openbsd.c

@@ -14,7 +14,7 @@ bool build_musializer(void)
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
                 nob_cmd_append(&cmd, "-I.");
-                nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+                nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
                 nob_cmd_append(&cmd, "-fPIC", "-shared");
                 nob_cmd_append(&cmd, "-o", "./build/libplug.so");
                 nob_cmd_append(&cmd, "./thirdparty/tinyfiledialogs.c");
@@ -31,7 +31,7 @@ bool build_musializer(void)
                 nob_cmd_append(&cmd, "cc");
                 nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
                 nob_cmd_append(&cmd, "-I.");
-                nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+                nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
                 nob_cmd_append(&cmd, "-o", "./build/musializer");
                 nob_cmd_append(&cmd,
                     "./src/musializer.c",
@@ -53,7 +53,7 @@ bool build_musializer(void)
             nob_cmd_append(&cmd, "cc");
             nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
             nob_cmd_append(&cmd, "-I.");
-            nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+            nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
             nob_cmd_append(&cmd, "-o", "./build/musializer");
             nob_cmd_append(&cmd, "./thirdparty/tinyfiledialogs.c");
             nob_cmd_append(&cmd,
@@ -92,7 +92,7 @@ bool build_raylib(void)
     }
 
     for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
-        const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
+        const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
         const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
         output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
 
@@ -103,7 +103,7 @@ bool build_raylib(void)
             nob_cmd_append(&cmd, "cc");
             nob_cmd_append(&cmd, "-w");
             nob_cmd_append(&cmd, "-ggdb", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
-            nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
+            nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
             nob_cmd_append(&cmd, "-c", input_path);
             nob_cmd_append(&cmd, "-o", output_path);
             nob_cmd_append(&cmd, "-I/usr/X11R6/include");

+ 5 - 5
src_build/nob_win64_mingw.c

@@ -26,7 +26,7 @@ bool build_musializer(void)
                 nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
                 nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
                 nob_cmd_append(&cmd, "-I.");
-                nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+                nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
                 nob_cmd_append(&cmd, "-fPIC", "-shared");
                 nob_cmd_append(&cmd, "-static-libgcc");
                 nob_cmd_append(&cmd, "-o", "./build/libplug.dll");
@@ -44,7 +44,7 @@ bool build_musializer(void)
                 nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
                 nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
                 nob_cmd_append(&cmd, "-I.");
-                nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+                nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
                 nob_cmd_append(&cmd, "-o", "./build/musializer");
                 nob_cmd_append(&cmd,
                     "./src/musializer.c",
@@ -66,7 +66,7 @@ bool build_musializer(void)
         nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
         nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
         nob_cmd_append(&cmd, "-I.");
-        nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+        nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
         nob_cmd_append(&cmd, "-o", "./build/musializer");
         nob_cmd_append(&cmd,
             "./src/plug.c",
@@ -108,7 +108,7 @@ bool build_raylib()
     }
 
     for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
-        const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
+        const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
         const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
         output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
 
@@ -120,7 +120,7 @@ bool build_raylib()
             nob_cmd_append(&cmd, "-ggdb", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
             nob_cmd_append(&cmd, "-DPLATFORM_DESKTOP");
             nob_cmd_append(&cmd, "-fPIC");
-            nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
+            nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
             nob_cmd_append(&cmd, "-c", input_path);
             nob_cmd_append(&cmd, "-o", output_path);
 

+ 5 - 5
src_build/nob_win64_msvc.c

@@ -20,7 +20,7 @@ bool build_musializer(void)
             nob_cmd_append(&cmd, "/LD");
             nob_cmd_append(&cmd, "/Fobuild\\", "/Fe./build/libplug.dll");
             nob_cmd_append(&cmd, "/I", "./");
-            nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+            nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
             nob_cmd_append(&cmd,
                 "src/plug.c",
                 "src/ffmpeg_windows.c",
@@ -35,7 +35,7 @@ bool build_musializer(void)
         cmd.count = 0;
             nob_cmd_append(&cmd, "cl.exe");
             nob_cmd_append(&cmd, "/I", "./");
-            nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+            nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
             nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
             nob_cmd_append(&cmd,
                 "./src/musializer.c",
@@ -54,7 +54,7 @@ bool build_musializer(void)
     cmd.count = 0;
         nob_cmd_append(&cmd, "cl.exe");
         nob_cmd_append(&cmd, "/I", "./");
-        nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
+        nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
         nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
         nob_cmd_append(&cmd,
             "./src/musializer.c",
@@ -98,7 +98,7 @@ bool build_raylib(void)
     }
 
     for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
-        const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
+        const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
         const char *output_path = nob_temp_sprintf("%s/%s.obj", build_path, raylib_modules[i]);
 
         nob_da_append(&object_files, output_path);
@@ -109,7 +109,7 @@ bool build_raylib(void)
             #ifdef MUSIALIZER_HOTRELOAD
                 nob_cmd_append(&cmd, "/DBUILD_LIBTYPE_SHARED");
             #endif
-            nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
+            nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER"external/glfw/include");
             nob_cmd_append(&cmd, "/c", input_path);
             nob_cmd_append(&cmd, nob_temp_sprintf("/Fo%s", output_path));
             Nob_Proc proc = nob_cmd_run_async(cmd);