Changeset View
Changeset View
Standalone View
Standalone View
devel/xxhash/files/patch-git_5ab73ee
- This file was added.
Property | Old Value | New Value |
---|---|---|
fbsd:nokeywords | null | yes \ No newline at end of property |
svn:eol-style | null | native \ No newline at end of property |
svn:mime-type | null | text/plain \ No newline at end of property |
From 5ab73ee82245b586f69762411edc7824d778ee2a Mon Sep 17 00:00:00 2001 | |||||
From: Chris Kitching <chriskitching@linux.com> | |||||
Date: Tue, 15 Nov 2016 10:15:48 +0000 | |||||
Subject: [PATCH] Rely on BUILD_SHARED_LIBS instead of custom options | |||||
Instead of having your own option for choosing between static | |||||
and shared versions of the library, use cmake's built-in option | |||||
for this: | |||||
https://cmake.org/cmake/help/v3.0/variable/BUILD_SHARED_LIBS.html | |||||
Set -DBUILD_SHARED_LIBS=ON to get a shared library, and omit it | |||||
or set it to OFF to get a static one. | |||||
Can add one extra line to the cmake file to make the default be | |||||
shared. Makes most of the cmake crap go away. | |||||
--- | |||||
cmake_unofficial/CMakeLists.txt | 23 +++++------------------ | |||||
1 file changed, 5 insertions(+), 18 deletions(-) | |||||
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt | |||||
index 0d7cf74..b91acf4 100644 | |||||
--- cmake_unofficial/CMakeLists.txt | |||||
+++ cmake_unofficial/CMakeLists.txt | |||||
@@ -6,27 +6,14 @@ project(xxhash) | |||||
set(XXHASH_LIB_VERSION "0.42.0") | |||||
set(XXHASH_LIB_SOVERSION "0") | |||||
-option(BUILD_SHARED_LIBS "Set to ON to build shared libraries" ON) | |||||
-option(BUILD_STATIC_LIBS "Set to ON to build static libraries" ON) | |||||
- | |||||
-if(BUILD_SHARED_LIBS) | |||||
- add_library(xxhash SHARED ../xxhash.c) | |||||
- set_target_properties(xxhash PROPERTIES COMPILE_DEFINITIONS "XXHASH_EXPORT" | |||||
- VERSION "${XXHASH_LIB_VERSION}" | |||||
- SOVERSION "${XXHASH_LIB_SOVERSION}") | |||||
- LIST(APPEND install_libs xxhash) | |||||
-endif(BUILD_SHARED_LIBS) | |||||
- | |||||
-if(BUILD_STATIC_LIBS) | |||||
- add_library(xxhashstatic ../xxhash.c) | |||||
- set_target_properties(xxhashstatic PROPERTIES OUTPUT_NAME xxhash) | |||||
- LIST(APPEND install_libs xxhashstatic) | |||||
-endif(BUILD_STATIC_LIBS) | |||||
- | |||||
+add_library(xxhash ../xxhash.c) | |||||
+set_target_properties(xxhash PROPERTIES COMPILE_DEFINITIONS "XXHASH_EXPORT" | |||||
+ VERSION "${XXHASH_LIB_VERSION}" | |||||
+ SOVERSION "${XXHASH_LIB_SOVERSION}") | |||||
INSTALL(FILES ../xxhash.h DESTINATION include) | |||||
INSTALL( | |||||
- TARGETS ${install_libs} | |||||
+ TARGETS xxhash | |||||
RUNTIME DESTINATION bin | |||||
ARCHIVE DESTINATION lib | |||||
LIBRARY DESTINATION lib |