From: Georg Sauthoff Date: Sat, 27 Aug 2016 08:56:08 +0000 (+0200) Subject: remove additional -fPIC switch because X-Git-Tag: upstream/1.9.3~141^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b0d42cb7ec9e29972db425631ef6026612e3aed9;p=platform%2Fupstream%2Flz4.git 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 --- 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