From: Magnus Jacobsson Date: Wed, 18 Aug 2021 11:00:27 +0000 (+0200) Subject: gvc: CMake: link to ltdl even on Windows with MinGW X-Git-Tag: 2.49.1~51^2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=367c6810a5649ddc9120d111cd6228296f684c22;p=graphviz gvc: CMake: link to ltdl even on Windows with MinGW Fixes these errors with MinGW: C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x4f7): undefined reference to `lt_dlinit' C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x529): undefined reference to `lt_dlopen' C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x578): undefined reference to `lt_dlerror' C:/tools/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/gvc.dir/objects.a(gvplugin.c.obj):gvplugin.c:(.text+0x69e): undefined reference to `lt_dlsym' collect2.exe: error: ld returned 1 exit status --- diff --git a/lib/gvc/CMakeLists.txt b/lib/gvc/CMakeLists.txt index 8f2ccc844..e5cc709cd 100644 --- a/lib/gvc/CMakeLists.txt +++ b/lib/gvc/CMakeLists.txt @@ -65,7 +65,7 @@ target_link_libraries(gvc PUBLIC if (LTDL_FOUND) target_include_directories(gvc PRIVATE ${LTDL_INCLUDE_DIRS}) - if (NOT WIN32) + if (NOT WIN32 OR MINGW) target_link_libraries(gvc PUBLIC ${LTDL_LIBRARIES}) endif() endif()