OpenMiInk/third_party/krita-deps-management/ext_ocio/0001-Fix-linking-to-self-built-deps-on-Windows-Clang.patch
Hellings b8c8ff98e2 Hi
2026-10-16 09:05:56 -04:00

49 lines
2.1 KiB
Diff

From 4c6593f14a79f3fb8fe5624e2e286da7c9ffc614 Mon Sep 17 00:00:00 2001
From: Dmitry Kazakov <dimula73@gmail.com>
Date: Tue, 10 Mar 2026 15:22:08 +0100
Subject: [PATCH] Fix linking to self-built deps on Windows + Clang
1) Expat: 'MD' suffix is added on MSVC only, 'd' suffix is added on WIN32
2) ZLib: 'd' suffix is added only on MSVC
---
share/cmake/modules/install/InstallZLIB.cmake | 4 ++--
share/cmake/modules/install/Installexpat.cmake | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/share/cmake/modules/install/InstallZLIB.cmake b/share/cmake/modules/install/InstallZLIB.cmake
index 6cfca280..96f09bb0 100644
--- a/share/cmake/modules/install/InstallZLIB.cmake
+++ b/share/cmake/modules/install/InstallZLIB.cmake
@@ -53,8 +53,8 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
set(ZLIB_INCLUDE_DIRS "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
- # Windows need the "d" suffix at the end.
- if(WIN32 AND BUILD_TYPE_DEBUG)
+ # Windows need the "d" suffix at the end (only for MSVC).
+ if(MSVC AND BUILD_TYPE_DEBUG)
set(_ZLIB_LIB_SUFFIX "d")
endif()
diff --git a/share/cmake/modules/install/Installexpat.cmake b/share/cmake/modules/install/Installexpat.cmake
index cda46531..ee750a1f 100644
--- a/share/cmake/modules/install/Installexpat.cmake
+++ b/share/cmake/modules/install/Installexpat.cmake
@@ -46,9 +46,11 @@ if(NOT expat_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAG
if(BUILD_TYPE_DEBUG)
set(_expat_LIB_SUFFIX "d")
endif()
- # Static Linking, Multi-threaded Dll naming (>=2.2.8):
- # https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
- set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
+ if (MSVC)
+ # Static Linking, Multi-threaded Dll naming (>=2.2.8):
+ # https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
+ set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
+ endif()
endif()
# Expat use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX
--
2.49.0.windows.1