List Archive

Thread

Thread Index

Message

From: Michał Janiszewski <janisozaur%gmail.com@localhost>
To: Thomas Klausner <tk%giga.or.at@localhost>
Subject: Re: vcpkg support/static builds
Date: Mon, 14 Aug 2017 13:02:06 +0200

Hi,
thanks for the update.
Since I posted the previous message, I've learned about CMake-3.0+ standard option "BUILD_SHARED_LIBS": https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html
This allows user to set upon configuration whether they want a shared or static library, but only for `add_library` targets. All other things retain their linking mode.
See it getting used here: https://github.com/OpenRCT2/OpenRCT2/pull/6145/files
Seeing how both your static and shared paths are the same, perhaps you may want to investigate using said option.
Cheers,
Michał

On Mon, Aug 14, 2017 at 12:46 PM, Thomas Klausner <tk%giga.or.at@localhost> wrote:
Hi Michal!

On Sun, Jun 18, 2017 at 11:35:04PM +0200, Michał Janiszewski wrote:
> Together with some other people we are working on a project, OpenRCT2.
> We use libzip there and have found it to be somewhat problematic to build a
> configuration we want for Windows, which is a static build.
> Ted, our lead dev and all-around Windows guy, has submitted a request to
> have libzip packaged for vcpkg: https://github.com/Microsoft/vcpkg/pull/1305
> As we are not so well-versed in CMake, can you please take a look at this
> change and consider upstreaming relevant parts?

Please take another look at README.md :)
Quoting:

> When using a static Windows library, you need to define `ZIP_STATIC`
> when compiling packages using libzip.

I'm pretty sure that the new ZIP_EXTERN_OVERRIDE does nothing else,
and you should use ZIP_STATIC instead.

If ZIP_STATIC is not working for you, please tell us more details.

I've added a cmake ENABLE_STATIC option that builds the static library
instead of the shared one, per your suggestion.

Thanks,
 Thomas



--
Michal Janiszewski

Made by MHonArc.