summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYann Collet <Cyan4973@users.noreply.github.com>2016-11-13 03:47:36 (GMT)
committerGitHub <noreply@github.com>2016-11-13 03:47:36 (GMT)
commit4bd9db1dd279d89dfe32a0d9b7c3e7ab3e169b4f (patch)
tree7caa218f7344c219e949413e354fe7fe5e3fb83e
parentf42130ee44d47105c9d86064b3f68d10af6a10f5 (diff)
parent151021a3a628189e072d828ff01247063b9baddc (diff)
downloadlz4-4bd9db1dd279d89dfe32a0d9b7c3e7ab3e169b4f.zip
lz4-4bd9db1dd279d89dfe32a0d9b7c3e7ab3e169b4f.tar.gz
lz4-4bd9db1dd279d89dfe32a0d9b7c3e7ab3e169b4f.tar.bz2
Merge pull request #268 from nemequ/dev
cmake: make PIC configurable, add copyright and maintainer info
-rw-r--r--contrib/cmake_unofficial/CMakeLists.txt24
1 files changed, 23 insertions, 1 deletions
diff --git a/contrib/cmake_unofficial/CMakeLists.txt b/contrib/cmake_unofficial/CMakeLists.txt
index 9324338..de070d6 100644
--- a/contrib/cmake_unofficial/CMakeLists.txt
+++ b/contrib/cmake_unofficial/CMakeLists.txt
@@ -1,3 +1,15 @@
+# CMake support for LZ4
+#
+# To the extent possible under law, the author(s) have dedicated all
+# copyright and related and neighboring rights to this software to
+# the public domain worldwide. This software is distributed without
+# any warranty.
+#
+# For details, see <http://creativecommons.org/publicdomain/zero/1.0/>.
+#
+# LZ4's CMake support is maintained by Evan Nemerson; when filing
+# bugs please mention @nemequ to make sure I see it.
+
set(LZ4_TOP_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../..")
# Parse version information
@@ -74,12 +86,22 @@ set(LZ4_CLI_SOURCES
"${LZ4_PROG_SOURCE_DIR}/lz4io.c"
"${LZ4_PROG_SOURCE_DIR}/datagen.c")
+# Whether to use position independent code for the static library. If
+# we're building a shared library this is ignored and PIC is always
+# used.
+option(LZ4_POSITION_INDEPENDENT_LIB "Use position independent code for static library (if applicable)" ON)
+if(LZ4_POSITION_INDEPENDENT_LIB OR BUILD_SHARED_LIBS)
+ set(LZ4_POSITION_INDEPENDENT_CODE TRUE)
+else()
+ set(LZ4_POSITION_INDEPENDENT_CODE FALSE)
+endif()
+
# liblz4
add_library(lz4 ${LZ4_SOURCES})
set_target_properties(lz4 PROPERTIES
SOVERSION "${LZ4_VERSION_STRING}"
VERSION "${LZ4_VERSION_STRING}"
- POSITION_INDEPENDENT_CODE TRUE)
+ POSITION_INDEPENDENT_CODE ${LZ4_POSITION_INDEPENDENT_CODE})
# lz4
add_executable(lz4cli ${LZ4_CLI_SOURCES})