Skip to content

Commit d14b316

Browse files
committed
Introduce RAYLIB_SRC_FOLDER
1 parent 0fcee38 commit d14b316

6 files changed

Lines changed: 26 additions & 25 deletions

File tree

src_build/configurer.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#define RAYLIB_VERSION "5.5"
22
#define CONFIG_PATH "./build/config.h"
3+
#define RAYLIB_SRC_FOLDER "./thirdparty/raylib-" RAYLIB_VERSION "/src/"
34

45
typedef struct {
56
const char *macro;

src_build/nob_linux.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ bool build_musializer(void)
1111
// Like `clang` for instance
1212
nob_cmd_append(&cmd, "cc",
1313
"-Wall", "-Wextra", "-ggdb",
14-
"-I.", "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
14+
"-I.", "-I"RAYLIB_SRC_FOLDER,
1515
"-fPIC", "-shared",
1616
"-o", "./build/libplug.so",
1717
"./src/plug.c", "./src/ffmpeg_posix.c", "./thirdparty/tinyfiledialogs.c",
@@ -22,7 +22,7 @@ bool build_musializer(void)
2222

2323
nob_cmd_append(&cmd, "cc",
2424
"-Wall", "-Wextra", "-ggdb",
25-
"-I.", "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
25+
"-I.", "-I"RAYLIB_SRC_FOLDER,
2626
"-o", "./build/musializer",
2727
"./src/musializer.c", "./src/hotreload_posix.c",
2828
"-Wl,-rpath=./build/",
@@ -40,7 +40,7 @@ bool build_musializer(void)
4040
nob_cmd_append(&cmd, "cc",
4141
"-Wall", "-Wextra", "-ggdb",
4242
"-I.",
43-
"-I./thirdparty/raylib-"RAYLIB_VERSION"/src/",
43+
"-I"RAYLIB_SRC_FOLDER,
4444
"-o", "./build/musializer",
4545
"./src/plug.c", "./src/ffmpeg_posix.c", "./src/musializer.c", "./thirdparty/tinyfiledialogs.c",
4646
nob_temp_sprintf("-L./build/raylib/%s", MUSIALIZER_TARGET_NAME), "-l:libraylib.a",
@@ -74,7 +74,7 @@ bool build_raylib(void)
7474
}
7575

7676
for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
77-
const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
77+
const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
7878
const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
7979
output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
8080

@@ -83,7 +83,7 @@ bool build_raylib(void)
8383
if (nob_needs_rebuild(output_path, &input_path, 1)) {
8484
nob_cmd_append(&cmd, "cc",
8585
"-ggdb", "-DPLATFORM_DESKTOP", "-D_GLFW_X11", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1",
86-
"-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include",
86+
"-I"RAYLIB_SRC_FOLDER"external/glfw/include",
8787
"-c", input_path,
8888
"-o", output_path);
8989
nob_da_append(&procs, nob_cmd_run_async_and_reset(&cmd));

src_build/nob_macos.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ bool build_musializer(void)
1616
nob_cmd_append(&cmd, "clang");
1717
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
1818
nob_cmd_append(&cmd, "-I.");
19-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
19+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
2020
nob_cmd_append(&cmd, "-fPIC", "-shared");
2121
nob_cmd_append(&cmd, "-o", "./build/libplug.dylib");
2222
nob_cmd_append(&cmd,
@@ -31,7 +31,7 @@ bool build_musializer(void)
3131
nob_cmd_append(&cmd, "clang");
3232
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
3333
nob_cmd_append(&cmd, "-I.");
34-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
34+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
3535
nob_cmd_append(&cmd, "-o", "./build/musializer");
3636
nob_cmd_append(&cmd,
3737
"./src/musializer.c",
@@ -49,7 +49,7 @@ bool build_musializer(void)
4949
nob_cmd_append(&cmd, "clang");
5050
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-g");
5151
nob_cmd_append(&cmd, "-I.");
52-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
52+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
5353
nob_cmd_append(&cmd, "-o", "./build/musializer");
5454
nob_cmd_append(&cmd,
5555
"./src/plug.c",
@@ -93,7 +93,7 @@ bool build_raylib(void)
9393
}
9494

9595
for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
96-
const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
96+
const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
9797
const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
9898

9999
nob_da_append(&object_files, output_path);
@@ -102,7 +102,7 @@ bool build_raylib(void)
102102
cmd.count = 0;
103103
nob_cmd_append(&cmd, "clang");
104104
nob_cmd_append(&cmd, "-g", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
105-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
105+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
106106
nob_cmd_append(&cmd, "-Iexternal/glfw/deps/ming");
107107
nob_cmd_append(&cmd, "-DGRAPHICS_API_OPENGL_33");
108108
if(strcmp(raylib_modules[i], "rglfw") == 0) {

src_build/nob_openbsd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ bool build_musializer(void)
1414
nob_cmd_append(&cmd, "cc");
1515
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
1616
nob_cmd_append(&cmd, "-I.");
17-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
17+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
1818
nob_cmd_append(&cmd, "-fPIC", "-shared");
1919
nob_cmd_append(&cmd, "-o", "./build/libplug.so");
2020
nob_cmd_append(&cmd, "./thirdparty/tinyfiledialogs.c");
@@ -31,7 +31,7 @@ bool build_musializer(void)
3131
nob_cmd_append(&cmd, "cc");
3232
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
3333
nob_cmd_append(&cmd, "-I.");
34-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
34+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
3535
nob_cmd_append(&cmd, "-o", "./build/musializer");
3636
nob_cmd_append(&cmd,
3737
"./src/musializer.c",
@@ -53,7 +53,7 @@ bool build_musializer(void)
5353
nob_cmd_append(&cmd, "cc");
5454
nob_cmd_append(&cmd, "-Wall", "-Wextra", "-ggdb");
5555
nob_cmd_append(&cmd, "-I.");
56-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
56+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
5757
nob_cmd_append(&cmd, "-o", "./build/musializer");
5858
nob_cmd_append(&cmd, "./thirdparty/tinyfiledialogs.c");
5959
nob_cmd_append(&cmd,
@@ -92,7 +92,7 @@ bool build_raylib(void)
9292
}
9393

9494
for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
95-
const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
95+
const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
9696
const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
9797
output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
9898

@@ -103,7 +103,7 @@ bool build_raylib(void)
103103
nob_cmd_append(&cmd, "cc");
104104
nob_cmd_append(&cmd, "-w");
105105
nob_cmd_append(&cmd, "-ggdb", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
106-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
106+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
107107
nob_cmd_append(&cmd, "-c", input_path);
108108
nob_cmd_append(&cmd, "-o", output_path);
109109
nob_cmd_append(&cmd, "-I/usr/X11R6/include");

src_build/nob_win64_mingw.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ bool build_musializer(void)
2626
nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
2727
nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
2828
nob_cmd_append(&cmd, "-I.");
29-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
29+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
3030
nob_cmd_append(&cmd, "-fPIC", "-shared");
3131
nob_cmd_append(&cmd, "-static-libgcc");
3232
nob_cmd_append(&cmd, "-o", "./build/libplug.dll");
@@ -44,7 +44,7 @@ bool build_musializer(void)
4444
nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
4545
nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
4646
nob_cmd_append(&cmd, "-I.");
47-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
47+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
4848
nob_cmd_append(&cmd, "-o", "./build/musializer");
4949
nob_cmd_append(&cmd,
5050
"./src/musializer.c",
@@ -66,7 +66,7 @@ bool build_musializer(void)
6666
nob_cmd_append(&cmd, "x86_64-w64-mingw32-gcc");
6767
nob_cmd_append(&cmd, "-mwindows", "-Wall", "-Wextra", "-ggdb");
6868
nob_cmd_append(&cmd, "-I.");
69-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/");
69+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER);
7070
nob_cmd_append(&cmd, "-o", "./build/musializer");
7171
nob_cmd_append(&cmd,
7272
"./src/plug.c",
@@ -108,7 +108,7 @@ bool build_raylib()
108108
}
109109

110110
for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
111-
const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
111+
const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
112112
const char *output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
113113
output_path = nob_temp_sprintf("%s/%s.o", build_path, raylib_modules[i]);
114114

@@ -120,7 +120,7 @@ bool build_raylib()
120120
nob_cmd_append(&cmd, "-ggdb", "-DPLATFORM_DESKTOP", "-fPIC", "-DSUPPORT_FILEFORMAT_FLAC=1");
121121
nob_cmd_append(&cmd, "-DPLATFORM_DESKTOP");
122122
nob_cmd_append(&cmd, "-fPIC");
123-
nob_cmd_append(&cmd, "-I./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
123+
nob_cmd_append(&cmd, "-I"RAYLIB_SRC_FOLDER"external/glfw/include");
124124
nob_cmd_append(&cmd, "-c", input_path);
125125
nob_cmd_append(&cmd, "-o", output_path);
126126

src_build/nob_win64_msvc.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ bool build_musializer(void)
2020
nob_cmd_append(&cmd, "/LD");
2121
nob_cmd_append(&cmd, "/Fobuild\\", "/Fe./build/libplug.dll");
2222
nob_cmd_append(&cmd, "/I", "./");
23-
nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
23+
nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
2424
nob_cmd_append(&cmd,
2525
"src/plug.c",
2626
"src/ffmpeg_windows.c",
@@ -35,7 +35,7 @@ bool build_musializer(void)
3535
cmd.count = 0;
3636
nob_cmd_append(&cmd, "cl.exe");
3737
nob_cmd_append(&cmd, "/I", "./");
38-
nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
38+
nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
3939
nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
4040
nob_cmd_append(&cmd,
4141
"./src/musializer.c",
@@ -54,7 +54,7 @@ bool build_musializer(void)
5454
cmd.count = 0;
5555
nob_cmd_append(&cmd, "cl.exe");
5656
nob_cmd_append(&cmd, "/I", "./");
57-
nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/");
57+
nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER);
5858
nob_cmd_append(&cmd, "/Fobuild\\", "/Febuild\\musializer.exe");
5959
nob_cmd_append(&cmd,
6060
"./src/musializer.c",
@@ -98,7 +98,7 @@ bool build_raylib(void)
9898
}
9999

100100
for (size_t i = 0; i < NOB_ARRAY_LEN(raylib_modules); ++i) {
101-
const char *input_path = nob_temp_sprintf("./thirdparty/raylib-"RAYLIB_VERSION"/src/%s.c", raylib_modules[i]);
101+
const char *input_path = nob_temp_sprintf(RAYLIB_SRC_FOLDER"%s.c", raylib_modules[i]);
102102
const char *output_path = nob_temp_sprintf("%s/%s.obj", build_path, raylib_modules[i]);
103103

104104
nob_da_append(&object_files, output_path);
@@ -109,7 +109,7 @@ bool build_raylib(void)
109109
#ifdef MUSIALIZER_HOTRELOAD
110110
nob_cmd_append(&cmd, "/DBUILD_LIBTYPE_SHARED");
111111
#endif
112-
nob_cmd_append(&cmd, "/I", "./thirdparty/raylib-"RAYLIB_VERSION"/src/external/glfw/include");
112+
nob_cmd_append(&cmd, "/I", RAYLIB_SRC_FOLDER"external/glfw/include");
113113
nob_cmd_append(&cmd, "/c", input_path);
114114
nob_cmd_append(&cmd, nob_temp_sprintf("/Fo%s", output_path));
115115
Nob_Proc proc = nob_cmd_run_async(cmd);

0 commit comments

Comments
 (0)