From c108a7735c499cea5560ffb3603f22cc8066ba7b Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Fri, 22 Oct 2021 11:11:57 -0400 Subject: [PATCH] add libs.cpp for header-only libs compilation unit --- src/asset.cpp | 3 --- src/libs.cpp | 12 ++++++++++++ src/util_image.cpp | 1 - 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 src/libs.cpp diff --git a/src/asset.cpp b/src/asset.cpp index d9abb55..9926872 100644 --- a/src/asset.cpp +++ b/src/asset.cpp @@ -2,9 +2,6 @@ #include #include -#define TINYGLTF_IMPLEMENTATION -//#define STB_IMAGE_IMPLEMENTATION -#define STB_IMAGE_WRITE_IMPLEMENTATION #include "tiny_gltf.h" #include "asset.h" diff --git a/src/libs.cpp b/src/libs.cpp new file mode 100644 index 0000000..e04c0b5 --- /dev/null +++ b/src/libs.cpp @@ -0,0 +1,12 @@ + +// NOTE: put all the header-only libs in a separate compilation unit to save on +// compile times + +#define TINYGLTF_IMPLEMENTATION +#include "tiny_gltf.h" + +#define STB_IMAGE_IMPLEMENTATION +#define STB_IMAGE_WRITE_IMPLEMENTATION +#include "stb_image.h" +#include "stb_image_write.h" + diff --git a/src/util_image.cpp b/src/util_image.cpp index 64c2e57..ed44be5 100644 --- a/src/util_image.cpp +++ b/src/util_image.cpp @@ -1,7 +1,6 @@ #include -#define STB_IMAGE_IMPLEMENTATION #include "stb_image.h" #include "dumbLog.h"