Merge pull request #985 from Sailsman63/64b_static_zlib

Building own zlib on 64bit Linux shared library requires -fPIC for C compiler.
pull/1003/head
Kim Kulling 2016-08-20 14:48:03 +02:00 committed by GitHub
commit 3fc384472a
1 changed files with 1 additions and 0 deletions

View File

@ -164,6 +164,7 @@ ENDIF()
IF((CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX) AND NOT CMAKE_COMPILER_IS_MINGW)
IF (BUILD_SHARED_LIBS AND CMAKE_SIZEOF_VOID_P EQUAL 8) # -fPIC is only required for shared libs on 64 bit
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
ENDIF()
# hide all not-exported symbols
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -std=c++0x" )