]> granicus.if.org Git - libevent/commit
cmake: introduce EVENT__LIBRARY_TYPE option
authorAzat Khuzhin <a3at.mail@gmail.com>
Thu, 22 Nov 2018 20:00:11 +0000 (23:00 +0300)
committerAzat Khuzhin <a3at.mail@gmail.com>
Thu, 22 Nov 2018 21:02:18 +0000 (00:02 +0300)
commitc9a073eae8f86a74fbbb125db34b881ef40108b7
tree3178bd86471372a9272e73e7cd71b706b69ef9d7
parentd705e8c0e924d3b815697a075c27a36298f04078
cmake: introduce EVENT__LIBRARY_TYPE option

Long time ago in [1] cmake build was forced to compile both libraries
(SHARED and STATIC), since this is how our autotools build works.

  [1]: 7182c2f561570cd9ceb704623ebe9ae3608c7b43 ("cmake: build SHARED and STATIC libraries (like autoconf does)")

And there is no way to configure this (and indeed you need to do this
for MSVC for example), so let's introduce option for this --
EVENT__LIBRARY_TYPE.

Plus now we have INTERFACE libraries, that we can use internally in
libevent's cmake rules to avoid strict to _shared/_static variant of the
libraries to link with samples/tests (we prefer SHARED over STATIC for
linking).

Also bump minimal cmake required version to 3.1 by the following
reasons:
- 3.1 is required for RPATH configuration under APPLE
- 3.0 is required for add_library(INTERFACE) (did not found it in 2.8.x
documentation)
- remove extra conditions
(anyway 3.1 was release 4 years ago, so I guess that most of the systems
will have it)
CMakeLists.txt
README.md
cmake/AddEventLibrary.cmake