From b8658cefe06b0f279a669993b4db6bb56e67c2ef Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Tue, 5 Apr 2022 18:48:45 +0200 Subject: [PATCH] Link std_image statically. --- code/AssetLib/M3D/M3DWrapper.h | 1 + code/Common/Assimp.cpp | 1 + code/Pbrt/PbrtExporter.cpp | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/code/AssetLib/M3D/M3DWrapper.h b/code/AssetLib/M3D/M3DWrapper.h index 7cc2d0eef..fac63d099 100644 --- a/code/AssetLib/M3D/M3DWrapper.h +++ b/code/AssetLib/M3D/M3DWrapper.h @@ -59,6 +59,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Share stb_image's PNG loader with other importers/exporters instead of bringing our own copy. #define STBI_ONLY_PNG +#define STB_IMAGE_STATIC #include #include "m3d.h" diff --git a/code/Common/Assimp.cpp b/code/Common/Assimp.cpp index 71e312cee..bd3861f2e 100644 --- a/code/Common/Assimp.cpp +++ b/code/Common/Assimp.cpp @@ -1290,6 +1290,7 @@ ASSIMP_API void aiQuaternionInterpolate( # endif # define STB_IMAGE_IMPLEMENTATION +# define STB_IMAGE_STATIC # include "stb/stb_image.h" # if _MSC_VER diff --git a/code/Pbrt/PbrtExporter.cpp b/code/Pbrt/PbrtExporter.cpp index 25061f517..ea29860d3 100644 --- a/code/Pbrt/PbrtExporter.cpp +++ b/code/Pbrt/PbrtExporter.cpp @@ -83,7 +83,16 @@ Other: #include #include +#if _MSC_VER // "unreferenced function has been removed" (SSE2 detection routine in x64 builds) +#pragma warning(push) +#pragma warning(disable : 4505) +#endif +#define STB_IMAGE_STATIC +#define STB_IMAGE_IMPLEMENTATION #include "stb/stb_image.h" +#if _MSC_VER +#pragma warning(pop) +#endif using namespace Assimp;