From 6fead2d54f14beef62afbfb834e1d4d23f867e76 Mon Sep 17 00:00:00 2001 From: Lior Lahav Date: Wed, 19 Jun 2024 01:09:03 +0300 Subject: [PATCH] Fixed: compilation for MINGW --- Codecs/CodecJPG/CMakeLists.txt | 2 +- Codecs/CodecPNG/CMakeLists.txt | 2 +- Codecs/CodecTiff/CMakeLists.txt | 3 +-- External/libpsd | 2 +- ImageUtil/CMakeLists.txt | 2 +- ImageUtil/Source/ImageUtil.cpp | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Codecs/CodecJPG/CMakeLists.txt b/Codecs/CodecJPG/CMakeLists.txt index b908b32..9a8e8e2 100644 --- a/Codecs/CodecJPG/CMakeLists.txt +++ b/Codecs/CodecJPG/CMakeLists.txt @@ -32,7 +32,7 @@ add_subdirectory(${libjpeg-turboFolder} ./external/libjpeg-turbo) target_include_directories(${TargetName} PRIVATE ${libjpeg-turboFolder}) target_link_libraries(${TargetName} turbojpeg) -if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND NOT MINGW) target_link_options(${TargetName} PUBLIC "/DELAYLOAD:$.dll") else() endif() \ No newline at end of file diff --git a/Codecs/CodecPNG/CMakeLists.txt b/Codecs/CodecPNG/CMakeLists.txt index 31b42de..169d25b 100644 --- a/Codecs/CodecPNG/CMakeLists.txt +++ b/Codecs/CodecPNG/CMakeLists.txt @@ -56,7 +56,7 @@ target_include_directories(${TargetName} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ext target_link_libraries(${TargetName} png_shared ) target_include_directories(png_shared PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/external/zlib) -if(MSVC) +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")) target_link_options(${TargetName} PUBLIC "/DELAYLOAD:$.dll") target_link_options(${TargetName} PUBLIC "/DELAYLOAD:$.dll") endif() \ No newline at end of file diff --git a/Codecs/CodecTiff/CMakeLists.txt b/Codecs/CodecTiff/CMakeLists.txt index 2fc1832..d2bc1ab 100644 --- a/Codecs/CodecTiff/CMakeLists.txt +++ b/Codecs/CodecTiff/CMakeLists.txt @@ -68,7 +68,6 @@ target_include_directories(${TargetName} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/ext target_link_libraries(${TargetName} tiff) -if(MSVC) - #set_property(TARGET tiff PROPERTY WINDOWS_EXPORT_ALL_SYMBOLS true) +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows" AND NOT MINGW) target_link_options(${TargetName} PUBLIC "/DELAYLOAD:$.dll") endif() diff --git a/External/libpsd b/External/libpsd index 2f78b03..e670ae0 160000 --- a/External/libpsd +++ b/External/libpsd @@ -1 +1 @@ -Subproject commit 2f78b031130e91477cd0d79105bc890be0382dbd +Subproject commit e670ae0be0c50a4afb83d3f1703cff1e6ca0c9ec diff --git a/ImageUtil/CMakeLists.txt b/ImageUtil/CMakeLists.txt index 56f619a..726f2d9 100644 --- a/ImageUtil/CMakeLists.txt +++ b/ImageUtil/CMakeLists.txt @@ -8,4 +8,4 @@ add_library (${TargetName} STATIC ${sourceFiles}) target_include_directories(${TargetName} PRIVATE ./Include) target_include_directories(${TargetName} PRIVATE ./Source) -target_include_directories(${TargetName} PRIVATE ../External/ExoticNumbers/Include) \ No newline at end of file +target_include_directories(${TargetName} PRIVATE ../External/ExoticNumbers/include) \ No newline at end of file diff --git a/ImageUtil/Source/ImageUtil.cpp b/ImageUtil/Source/ImageUtil.cpp index 82d0197..cbaac71 100644 --- a/ImageUtil/Source/ImageUtil.cpp +++ b/ImageUtil/Source/ImageUtil.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include