-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Build BTLS on Windows, Visual Studio. #11100
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
Build BTLS on Windows, Visual Studio. #11100
Conversation
96c3050 to
020d01e
Compare
baulig
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the MONO_API changes, but don't know much about compiling with msvc.
|
msvc has different consistency requirements around |
|
@directhex @jaykrell does any of you know something about building with msvc? The code changes look good to me, but I don't know enough about this build stuff. |
|
I'd just leave it to Johan, unless you insist that an expert author it, and a second expert review it. MONO_API is extern "C" and exported from .dll (__declspec(dllexport)), and whatever the wacky ELF stuff. |
|
Oh maybe it isn't quite that -- maybe msvc wants it on .h at least, can be also on .c. |
msvc/build-external-btls.bat
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer portable Python over any cmd but ok.
msvc/winsetup.bat
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for caps.
|
@lateralusX is it still do-not-merge ? |
|
I was waiting for #9306 to merge so I could do some testing with the defaults, but I believe we could merge this first and I can test with default BLTS settings in separate PR. |
|
Just hold on a little with the merge for now, will get library name change into this PR first as well as rebase locally with the changes merged in #9306. |
020d01e to
8e58049
Compare
8e58049 to
360620a
Compare
|
Failures are unrelated and happens on other PR's. |
PR setup BTLS build on Windows using Visual Studio msvc compiler. By default, BTLS builds will be disabled on Windows but can be enabled by passing --enable-btls when running ./autogen.sh after #9306 have been merged. Normal mono.sln Visual Studio build will look at configuration and decide if BTLS should be build based on that information (in original config.h). mono.sln have been extended with a new utility project and .bat file taking care of the complete BTLS build following the build configuration currently used in Visual Studio. This way the BTLS build will be an integrated build step part of the overall mono Visual Studio build. BTLS build has been setup to work under all Visual Studio mono build configuration, x86/x64 Debug/Release and build artifacts will end up under standard build tree and output directories.
PR also fixes several mismatches in mono BTLS code related to MONO_API in order to correctly build under msvc compiler and following the same pattern as used by all other mono runtime usage of MONO_API. PR also adjust a couple of warnings in mono’s BTLS code.
Since BTLS build relies on cmake, when enabling BTLS for Windows Visual Studio build, a Windows cmake version must be found or the build will fail. Build also needs to locate a working git version since it needs to make sure mono BTLS submodule has been correctly updated before building. NOTE, since the mono Visual Studio build is done before Cygwin build we can’t depend on the normal submodule update logic to take care of this.
In order to do a full BTLS build supporting assembler optimized encrypt/decrypt/hash functions the Visual Studio cmake generator can not be used. It also adds a number of additional prerequisites like yasm, ninja and perl to the build infrastructure. In order to take this in steps, this PR builds without assembler support making it possible to use cmake Visual Studio generators. Future PR’s will add support for assembler optimized BTLS build if the correct tools can be found on the build system.