-
Notifications
You must be signed in to change notification settings - Fork 78
Remove md5 and convert_utf from export set when installing #177
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
Conversation
All good now @bwrsandman ? |
I have one question. with this change header files are installed too now, which makes total sense for libunshield.h.
though? It feels like these are all internal headers. What do you think? Unrelated to this PR but your changes makes me wounder if the pkg-config file (https://github.com/twogood/unshield/blob/main/libunshield.pc.in) is not completely broken if build statically, as it does not mention libconvert_utf.a nor libmd5.a in this case. |
I had the same question about the headers. Additionally do you expect them in |
The purpose of the static build is for the unshield binary, you know like Go applications. A single file that can be scp:ed between systems and whatnot. But of course we could probably have a statically linkable linunshield.a as well, but it's not the priority. |
These must not be installed! |
Why do we need/build libconvert_utf.a or libmd5.a in the first place?
In case of dynamic linking we have one shared library (plus some symbolic links to it) as the object files from the static libraries just end up in the shared object file:
libconvert_utf.a and libmd5.a are always build as static libraries, see https://github.com/twogood/unshield/blob/main/lib/convert_utf/CMakeLists.txt#L13 and here https://github.com/twogood/unshield/blob/main/lib/md5/CMakeLists.txt I think there is no need to build those two as independent libraries and just included the object files in libunshield, |
Sounds like this should then be the installation and please correct me if I'm wrong:
I see the usefulness of have a portable exe, distributing dynamic libs on Linux is more standard and helps save space when packages depend on it. Doing both for a package is less standard but not too crazy. Packaging for dependency managers and package managers can also deal with how they want to have everything linked through options of the cmake. Here's what I suggest: Compiling statically and dynamically on github will give us the portable binary, the static and dynamic libs can co-exist. This can done by compiling both with static on and off, combining the results. That way anyone checking the releases, can find pre-compiled binaries and get going fast. I think the only tricky thing is cmake configs. Then package managers can compile from source and do it how they like. |
Latest push this is what it looks like when compiled (on mac)
non-static
|
87001cf
to
dd27d11
Compare
Resolved the issue with extra static libraries by using the This is what the installation looks like now static
non-static
|
Question: is Zlib a public dependency? By that I mean do headers leak includes from Zlib? Does a program linking dynamically with libunshield.so need to also link with Zlib or use the Zlib dev package? |
Yes, if you would link with libunshield you also need to link with zib, either dynamically or statically. |
@@ -1,4 +1,4 @@ | |||
cmake_minimum_required(VERSION 3.7) | |||
cmake_minimum_required(VERSION 3.21) |
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 see the need to increase this, because of https://cmake.org/cmake/help/latest/command/add_library.html#object-libraries
Shouldn't 3.12 be enough?
I did not test it yet, but just from looking at the diff this looks great, thanks @bwrsandman
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.
Using OBJECT
is 3.12 but using TARGET_OBJECTS
with them is 3.21. This allows us to not export convert_utf
and md5
during install.
See the difference in the last commit of the pr.
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.
It's clear now, thanks for the explanation.
Let's try this :) And happy holidays! |
In #164, I neglected to test on a system without an md5 install, not knowing the mechanism of
USE_OWN_MD5
.This PR fixes the issue of getting this error about the export sets
There is also an issue of too many static libs being installed.