martinling / libserialport

Unofficial personal repository for libserialport - see git://sigrok.org/libserialport for official repo
http://sigrok.org/wiki/Libserialport
GNU Lesser General Public License v3.0
65 stars 34 forks source link

Inquiry - Windows native linking #34

Closed thestumbler closed 4 years ago

thestumbler commented 5 years ago

I've used and tested libserialport in our multiplatform project in Linux and Mac. I'm a little fuzzy on using it in Windows. I have successfully followed the build instructions (first building mex and then running the script from sigrok-util) to make the library.

But from reading the documentation, the expectation is that you will build your application entirely in mxe, like sigrok does, and that native building of sigrok is discouraged. What about native building of a non-sigrok application which only uses libserialport for serial communications? Is that possible? Since the building process that I went through only created linux library .a files, that suggests to me the answer is "no".

martinling commented 4 years ago

I have been working on improving support for native Windows builds recently. There is now a solution and project file which can be built out of the box with Visual Studio 2019 or the standalone MSBuild tool, on this branch: https://github.com/martinling/libserialport/commits/vs2019 It's also possible to build natively using the MSYS2 environment and MinGW-w64 compiler, but how to do this was not previously well documented - the updated README on that same branch includes some instructions for doing this.

martinling commented 4 years ago

The VS2019 build files and MSYS2/MinGW build instructions are now in upstream master so I'm going to close this issue.

thestumbler commented 4 years ago

Thanks, Martin. I’ve been busy with other aspects of my project, but will be revisiting this issue in the next week or two. Your revisions are perfectly timed. -Chris