Respect BUILD_SHARED_LIBS for libappimage#204
Respect BUILD_SHARED_LIBS for libappimage#204amazingakai wants to merge 1 commit intoAppImageCommunity:masterfrom
Conversation
6b49091 to
782bc0b
Compare
|
Your comment makes it sound like this was, I don't know, a standard option or something that already existed but had a bug or similar. What's the motivation for this addition? It clearly adds some complexity, so I feel there needs to be some justification. |
Currently libappimage is always built as a SHARED library, and libappimage_static is neither installed nor exported as a proper STATIC target (please correct me if I'm wrong here), so there is no way to link to it directly. By default both static and shared variants are built, which most users don't need and which adds unnecessary overhead. The two target setup (libappimage/libappimage_static) is also non-standard and adds extra work for downstream users. I needed a static build and had no straightforward way to get it without custom CMake logic to decide which target to link to based on the environment. This change replaces the two-target setup with the standard BUILD_SHARED_LIBS option, so consumers can choose static or shared builds from the same target without extra hacks. |
9bedc20 to
ba6c2ed
Compare
ba6c2ed to
690d85a
Compare
|
ping |
Updates the build setup to respect the
BUILD_SHARED_LIBSflag when building libappimage.BUILD_SHARED_LIBSisOn, builds a shared lib and links to xdg-basedirOff, builds a static lib and embeds xdg-basedir object files directlyAlso removes the hardcoded
libappimage_statictarget.Defaults to shared build.
cmake/imported_dependencies.cmakeused when building statically.