From fc5f065269045af8f70f11c116e024952974f611 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 31 Jul 2022 21:10:07 +0200 Subject: [PATCH] nanosvg: build implementation in extra c file Speed up development iterations by building the nanosvg implementation only once. Especially on the PinePhone it takes a bit. --- src/meson.build | 3 ++- src/nanosvg.c | 9 +++++++++ src/pbsplash.c | 2 -- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 src/nanosvg.c diff --git a/src/meson.build b/src/meson.build index 77f2b51..52b2bf3 100644 --- a/src/meson.build +++ b/src/meson.build @@ -1,6 +1,7 @@ src = [ - 'pbsplash.c', 'animate.c', + 'nanosvg.c', + 'pbsplash.c', ] executable('pbsplash', src, diff --git a/src/nanosvg.c b/src/nanosvg.c new file mode 100644 index 0000000..ecf037a --- /dev/null +++ b/src/nanosvg.c @@ -0,0 +1,9 @@ +/* Build the nanosvg implementation here, to build it only once and have other + * C files build fast during development. */ +#include + +#define NANOSVG_IMPLEMENTATION +#include "nanosvg.h" + +#define NANOSVGRAST_IMPLEMENTATION +#include "nanosvgrast.h" diff --git a/src/pbsplash.c b/src/pbsplash.c index 81e6304..60d2179 100644 --- a/src/pbsplash.c +++ b/src/pbsplash.c @@ -14,9 +14,7 @@ #include #include #define NANOSVG_ALL_COLOR_KEYWORDS // Include full list of color keywords. -#define NANOSVG_IMPLEMENTATION // Expands implementation #include "nanosvg.h" -#define NANOSVGRAST_IMPLEMENTATION #include "nanosvgrast.h" #include "pbsplash.h"