-
Notifications
You must be signed in to change notification settings - Fork 850
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
Refactor CMakeLists and make shared versions work for MSVC #35
Conversation
* Make building as a shared library on MSVC work for haicrypt * Up the CMake requirement to 3.0.2 * Add all arbitrary options as offical cmake options
Great request ! We get the same issues with dynamic build for windows |
That's nice, just please fix the following things:
We need these things preserved.
|
Thanks for the review!
Also, I realized that the DLLs weren't being put in the same dir as the exectuables (due to the subdirectories). I fixed that as well. |
Ok, so first: I'm really sorry for the confusion. I thought I put already this stuff for extracting the headers to install from HEADERS.maf file - please take the latest version from master on my replica, I've applied these changes. Additionally:
|
The header extraction method is great....on unix where Looking at the Also slightly unrelated question: why do you have the
|
Ah, right. I did it from the rush and again forgot about windows. Not sure if there can be created some method to extract the file list from a file of that format using only cmake methods. If so, and if you have a solution for that, it's definitely better. The reason why I have created this wrapper was that we had an internal request in the company before we have opened SRT. That CMake-based build should not do any autodetection - instead it should rely on the variables to do this. So, I have made a half-way: I've created a user-friendly script that is usable same way as Autotools configure, but it simply translates options to variables. At that time when I did it it was simpler for me to cover all the autodetection stuff (as I also had to widely improve it). Actually now the autodetection things can be also moved to CMake, then the configure script will just remain with translation or kinda "highly unusual" things. As it comes to HAVE_CROSSCOMPILER -well, one of the things that we had in our files that selected an alternative configuration for some special cases, in this particular case, a special kind of compiler that doesn't support C++11 (so, stransmit can't be compiled) and on ARM. This was also a platform where we know that OpenSSL is available, but any standard method to check it (pkg-config) would fail. So, it was used to assume that OpenSSL is there, just added some LDFLAGS, and done. I hope this thing might be able to be solved some simpler way - by providing some special value for HAVE_OPENSSL passed in the cmake command line. This HAVE_CROSSCOMPILER was for the case when cmake couldn't properly recognize the compiler as crosscompiler - we did extra test and declare that explicitly. Still haven't reviewed it, this week we have confs in Montreal concerning SRT, will try when I have some spare time, or otherwise only next week. I like much more these changes you do, though. |
As fas as the Thank you for all the help getting this in! |
we cannot wait for this to be integrated. Now we have to change CMakeLists.txt manually that leads to manually merge it for each new CMakeLists.txt on trunk. |
Alright, so, @russelltg , please now try to rebaseline this work to the latest version. |
Also if you want I can squash into a single commit :) |
Hello @russelltg , Could you please rebase your branch with current srt repo master? There are merge conflicts at the moment. Thanks! |
Merged up :). |
Much appreciated @russelltg ! Will wait for @ethouris to have a chance to review as well. |
Ok. Merging this, @ethouris will have to catch up at later time. |
I pretty much rewrote the CMakeLists.txt file and split it into three files. Mush shorter, much cleaner.
I also made sure we were exporting symbols from haicrypt when building for DLLs, so it compiles and runs now.
Another change is I use
find_package
in CMake to find the OpenSSL libraries and includes, so if they're in the default location they will be detected automatically. Same for pthread except CMake doesn't supply aFindPthread.cmake
file, so it uses some simplefind_path
andfind_library
calls.I updated the README to reflect these changes in the build system.
These changes are tested on windows MSVC 2013 for both static and shared and linux for both static and shared.
Also: