libusb-cmake as libusb provider and added MSVC Support #1440
+87
−67
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This pull request alters
Findlibusb.cmake
in order to add proper Windows MSVC handling. It discards the old MINGW approach and uses thelibusb-cmake
repository as the main provider instead for both Windows and Linux. As it stands now, iflibusb
is not installed for these two OSes, the libusb-cmake repository is being cloned and incorporated into the build. This way,'stlinkhas a freshly built
libusb, tailored to the system's configuration and needs, installed into the same
INSTALL_PREFIXas
stlink`.Additionally, this pull request adds Windows/MSVC support into the c/c++ github workflow.
Potential issues
In Windows, there is a possibility that the installation path for all
LIBRARY
items must be the same as the one ofRUNTIME
items, as opposed to the Linux paradime, whereLIBRARY
andARCHIVE
items are the ones that share location. This needs further investigation and potentialy a complementary fix, as I currently have no equipment and a clean environment to test it. I'll get back to it once I manage to prepare the proper testing ground.