From 22494bde1724fa1b71b9f159b24f0a7deb913e51 Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Fri, 23 Sep 2022 04:08:20 +0300 Subject: [PATCH] Don't include stm_image implementation if using stb library from Hunter Hunter compiles its own stb library binaries. Currently a second copy is compiled by defining STB_IMAGE_IMPLEMENTATION in Assimp.cpp. This may cause hard to understand bugs if this compiled copy ever becomes different from what Hunter supplies. --- code/Common/Assimp.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/code/Common/Assimp.cpp b/code/Common/Assimp.cpp index ee798238e..57ecb953c 100644 --- a/code/Common/Assimp.cpp +++ b/code/Common/Assimp.cpp @@ -1273,11 +1273,13 @@ ASSIMP_API void aiQuaternionInterpolate( #define ASSIMP_HAS_PBRT_EXPORT (!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_PBRT_EXPORTER) #define ASSIMP_HAS_M3D ((!ASSIMP_BUILD_NO_EXPORT && !ASSIMP_BUILD_NO_M3D_EXPORTER) || !ASSIMP_BUILD_NO_M3D_IMPORTER) -#if ASSIMP_HAS_PBRT_EXPORT -# define ASSIMP_NEEDS_STB_IMAGE 1 -#elif ASSIMP_HAS_M3D -# define ASSIMP_NEEDS_STB_IMAGE 1 -# define STBI_ONLY_PNG +#ifndef STB_USE_HUNTER +# if ASSIMP_HAS_PBRT_EXPORT +# define ASSIMP_NEEDS_STB_IMAGE 1 +# elif ASSIMP_HAS_M3D +# define ASSIMP_NEEDS_STB_IMAGE 1 +# define STBI_ONLY_PNG +# endif #endif // Ensure all symbols are linked correctly