Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support compiling on MSVC #13

Closed
j4james opened this issue Jun 30, 2018 · 5 comments
Closed

Support compiling on MSVC #13

j4james opened this issue Jun 30, 2018 · 5 comments

Comments

@j4james
Copy link

j4james commented Jun 30, 2018

I don't know if this is something that you'd necessarily want to support, but when I saw the work you were doing to get bef compiling on different platforms, I thought you might be interested in the patch I use to compile in Microsoft's Visual C (the cl command line compiler).

The only change required in the code was a mapping of the sleep function to Microsoft's _sleep. The bigger issue was getting a working Makefile. I don't believe it's possible to create something that's compatible with both GNU make and Microsoft's nmake, so I just created a completely separate NMakefile (I build with nmake -f NMakefile).

Anyway, if you're interested, I've included the patch below. This is against the develop-2018-1 branch, in case that matters. If you prefer a PR, I could probably do that too.

msvc-patch.txt

@cpressey
Copy link
Member

I've applied this patch on a branch off develop-2018-1 here.

I don't have anything to test it with at the moment but I'm sure it's fine.

I kind of prefer separate Makefiles/build scripts when architectures are significantly different anyway.

I'll try to get this into the 2.24 release.

@j4james
Copy link
Author

j4james commented Aug 22, 2018

Thanks for merging this. And FWIW, I can at least confirm that your branch works for me.

@cpressey cpressey mentioned this issue Aug 29, 2018
@cpressey
Copy link
Member

PR is here, if you want to review it: #15

Do you know the version of MSVC that it is known to compile with? If so, we can note that too.

@j4james
Copy link
Author

j4james commented Aug 30, 2018

The version numbering issue is kind of complicated. I have two versions of the IDE - Visual Studio 2015 and Visual Studio 2017 - and I had previously tested successfully with both of them. VS 2015 comes with MSVC++ 14.0, which for me has an internal version number of 19.00.24215.1 (that's what I see when calling cl.exe from the command line). VS 2017 has had a range of MSVC++ versions (14.10 to 14.15, with internal versions 19.10 to 19.15), and I'm currently on version 14.15 (internal version 19.15.26726).

The thing is, I've only just upgraded to 14.15 today and I'm not sure what I had before. And while 14.15 still works, it's now producing warnings about spectre mitigation, which I wasn't getting before. If we want those warnings suppressed, so we get a nice clean build, we'd need to add -wd5045 to the WARNS list.

In short, I can confirm for certain that it compiles on MSVC++ 14.0 and 14.15 (internal versions 19.00.24215.1 and 19.15.26726), but quite likely also everything in between. However, the latest version is producing warnings, which I'd probably recommend suppressing.

@cpressey
Copy link
Member

cpressey commented Sep 3, 2018

That's very entertaining reading. Well, I've called it 14.15 and suppressed that warning. Let's get this merged in and get something released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants