Merge pull request #3081

e0679ce cmake: cross-compilation to Windows - fix 'version' lib linking (xiphon)
This commit is contained in:
luigi1111 2020-09-14 11:34:38 -05:00
commit 6595a7b1c1
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

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()