cmake: cross-compilation to Windows - fix 'version' lib linking

This commit is contained in:
xiphon 2020-09-12 21:54:39 +00:00
parent 31dbe7ea42
commit e0679ce5e6

View file

@ -514,7 +514,11 @@ if (HIDAPI_FOUND OR LibUSB_COMPILE_TEST_PASSED)
endif()
endif()
if (WIN32)
list(APPEND EXTRA_LIBRARIES setupapi Version)
find_library(VERSION_LIBRARY version PATHS /usr/x86_64-w64-mingw32/lib)
if(VERSION_LIBRARY STREQUAL "VERSION_LIBRARY-NOTFOUND")
set(VERSION_LIBRARY Version)
endif()
list(APPEND EXTRA_LIBRARIES setupapi ${VERSION_LIBRARY})
endif()
endif()