]> granicus.if.org Git - graphviz/commitdiff
CMake: only use 'LTDL_LIBRARY' on non-Windows or MinGW
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 5 Nov 2022 19:56:09 +0000 (12:56 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Tue, 8 Nov 2022 04:52:51 +0000 (20:52 -0800)
When running CMake with `--warn-uninitialized -Werror=dev`, this prevents the
following:

  CMake Error (dev) at cmake/FindLTDL.cmake:18 (set):
    uninitialized variable 'LTDL_LIBRARY'
  Call Stack (most recent call first):
    CMakeLists.txt:117 (find_package)

Gitlab: #2291

cmake/FindLTDL.cmake

index a1ee8c2a2fc94cdb00c4a1db92a8ab0f622c333c..e955b745ee386e4d4282e2818d01fd8d96efe9a5 100644 (file)
@@ -15,4 +15,6 @@ endif()
 mark_as_advanced(LTDL_INCLUDE_DIR LTDL_LIBRARY)
 
 set(LTDL_INCLUDE_DIRS ${LTDL_INCLUDE_DIR})
-set(LTDL_LIBRARIES ${LTDL_LIBRARY})
+if(NOT WIN32 OR MINGW)
+  set(LTDL_LIBRARIES ${LTDL_LIBRARY})
+endif()