Skip to content

Commit 75bb9d0

Browse files
authored
Fix linking to self-built deps on Windows + Clang (#2273)
1) Expat: 'MD' suffix is added on MSVC only, 'd' suffix is added on WIN32 2) ZLib: 'd' suffix is added only on MSVC Signed-off-by: Dmitry Kazakov <dimula73@gmail.com>
1 parent c7612d1 commit 75bb9d0

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

share/cmake/modules/install/InstallZLIB.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ if(NOT ZLIB_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAGE
5353

5454
set(ZLIB_INCLUDE_DIRS "${_EXT_DIST_ROOT}/${CMAKE_INSTALL_INCLUDEDIR}")
5555

56-
# Windows need the "d" suffix at the end.
57-
if(WIN32 AND BUILD_TYPE_DEBUG)
56+
# Windows need the "d" suffix at the end (only for MSVC).
57+
if(MSVC AND BUILD_TYPE_DEBUG)
5858
set(_ZLIB_LIB_SUFFIX "d")
5959
endif()
6060

share/cmake/modules/install/Installexpat.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ if(NOT expat_FOUND AND OCIO_INSTALL_EXT_PACKAGES AND NOT OCIO_INSTALL_EXT_PACKAG
4646
if(BUILD_TYPE_DEBUG)
4747
set(_expat_LIB_SUFFIX "d")
4848
endif()
49-
# Static Linking, Multi-threaded Dll naming (>=2.2.8):
50-
# https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
51-
set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
49+
if (MSVC)
50+
# Static Linking, Multi-threaded Dll naming (>=2.2.8):
51+
# https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/win32/README.txt
52+
set(_expat_LIB_SUFFIX "${_expat_LIB_SUFFIX}MD")
53+
endif()
5254
endif()
5355

5456
# Expat use a hardcoded lib prefix instead of CMAKE_STATIC_LIBRARY_PREFIX

0 commit comments

Comments
 (0)