]> granicus.if.org Git - graphviz/commitdiff
gvc: CMake: link to ltdl even on Windows with MinGW
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Wed, 18 Aug 2021 11:00:27 +0000 (13:00 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 31 Aug 2021 10:09:52 +0000 (12:09 +0200)
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

lib/gvc/CMakeLists.txt

index 8f2ccc84455ee14bd26f8ac54c62147d6da71da0..e5cc709cd7d67f79754c6bb8c33c2d7e83281653 100644 (file)
@@ -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()