Skip to content

Commit da8c76b

Browse files
Lior LahavTheNicker
authored andcommitted
Gate delayimp to Windows MSVC builds
Restricts the ImageCodec delayimp link dependency to Windows MSVC-style toolchains and excludes MinGW. This keeps Linux and Clang builds from receiving an unsupported -ldelayimp linker input while preserving delay-load support for the Windows configuration that needs it.
1 parent 8e0f298 commit da8c76b

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

ImageCodec/CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ if ( ${IMCODEC_BUILD_CODEC_FREEIMAGE})
4747
endif()
4848

4949
target_link_libraries(${TargetName} PRIVATE TinyEXIFstatic)
50-
target_link_libraries(${TargetName} PUBLIC delayimp)
51-
52-
50+
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND
51+
(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC") AND
52+
NOT MINGW)
53+
target_link_libraries(${TargetName} PUBLIC delayimp)
54+
endif()

0 commit comments

Comments
 (0)