[pcre-dev] [Bug 2785] CMake: static library with PIC and CMa…

Top Page

Reply to this message
Author: admin
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 2785] CMake: static library with PIC and CMake config files
https://bugs.exim.org/show_bug.cgi?id=2785

--- Comment #4 from Jan-Willem Blokland <howisjw@???> ---
The other day, I have extended the CMake build system to build both static and
shared library in one go. The second attachment includes the first extension
(static library with PIC and config file) as well as the current extension.

In short:
- Introduced CMake variable BUILD_STATIC_LIBS to build the static library.
- Make a small modification to config-cmake.h.in by removing the PCRE2_STATIC 
  variable. Added PCRE2_STATIC variable to the static build using the 
  target_compile_definitions() function.
- Extended the CMake config files.
  - Introduced CMake variable PCRE2_USE_STATIC_LIBS to easily switch between
the 
    static and shared libraries.
  - Added the PCRE_STATIC variable to the target compile definitions for the 
    import of the static library.


When building static and shared library using MSVC results in a name clash of
the libraries. Both static and shared library build create, for example, the
file pcre2-8.lib. Therefore, I decided to change the static library names by
adding "-static". For example, pcre2-8.lib has become pcre2-8-static.lib.

--
You are receiving this mail because:
You are on the CC list for the bug.