diff options
author | Georg Sauthoff <mail@georg.so> | 2016-08-27 08:56:08 (GMT) |
---|---|---|
committer | Georg Sauthoff <mail@georg.so> | 2016-08-27 13:24:50 (GMT) |
commit | b0d42cb7ec9e29972db425631ef6026612e3aed9 (patch) | |
tree | 7ca4a9c06edb50498d79ebecdd2dd52f313e1d5c | |
parent | 681d5010d53cc2631ad96afa5dfc7ea70f13e5de (diff) | |
download | lz4-b0d42cb7ec9e29972db425631ef6026612e3aed9.zip lz4-b0d42cb7ec9e29972db425631ef6026612e3aed9.tar.gz lz4-b0d42cb7ec9e29972db425631ef6026612e3aed9.tar.bz2 |
remove additional -fPIC switch because
- cmake is smart enough to add this flag on its own (for object files
that it links into a shared library)
- cmake contains two sets of oject files - the position-dependent ones
and the position-independent ones - and uses each set accordingly
(for linking the executable, static library, shared library)
- having an executable that unnecessarily contains position-independent
code has performance implications
-rw-r--r-- | cmake_unofficial/CMakeLists.txt | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/cmake_unofficial/CMakeLists.txt b/cmake_unofficial/CMakeLists.txt index af39cb0..4c82f78 100644 --- a/cmake_unofficial/CMakeLists.txt +++ b/cmake_unofficial/CMakeLists.txt @@ -22,11 +22,6 @@ IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR SET(GNU_COMPATIBLE_COMPILER 1) ENDIF() -if(GNU_COMPATIBLE_COMPILER) -if(UNIX AND BUILD_LIBS) - add_definitions(-fPIC) -endif() -endif() set(LZ4_DIR ../lib/) set(PRG_DIR ../programs/) @@ -45,15 +40,15 @@ endif() if(BUILD_LIBS) - SET(LIBS_TARGETS "") - IF(NOT WIN32) - add_library(liblz4 SHARED ${LZ4_SRCS_LIB}) - add_library(liblz4_static STATIC ${LZ4_SRCS_LIB}) - SET_TARGET_PROPERTIES(liblz4_static PROPERTIES OUTPUT_NAME lz4) - SET(LIBS_TARGETS liblz4 liblz4_static) - ELSE(NOT WIN32) - add_library(liblz4 STATIC ${LZ4_SRCS_LIB}) - SET(LIBS_TARGETS liblz4) + SET(LIBS_TARGETS "") + IF(NOT WIN32) + add_library(liblz4 SHARED ${LZ4_SRCS_LIB}) + add_library(liblz4_static STATIC ${LZ4_SRCS_LIB}) + SET_TARGET_PROPERTIES(liblz4_static PROPERTIES OUTPUT_NAME lz4) + SET(LIBS_TARGETS liblz4 liblz4_static) + ELSE(NOT WIN32) + add_library(liblz4 STATIC ${LZ4_SRCS_LIB}) + SET(LIBS_TARGETS liblz4) ENDIF(NOT WIN32) set_target_properties(liblz4 PROPERTIES |