Building static ZLIB on 64b LInux requires -fPIC for C compiler.
authorLucas Stanek <lukejsails@gmail.com>
Thu, 18 Aug 2016 00:03:29 +0000 (00:03 +0000)
committerLucas Stanek <lukejsails@gmail.com>
Fri, 19 Aug 2016 03:28:53 +0000 (03:28 +0000)
CMakeLists.txt

index 8b7ac1a..c47fa5b 100644 (file)
@@ -164,6 +164,9 @@ 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")
+     IF(ASSIMP_BUILD_ZLIB)
+            SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+     ENDIF()
   ENDIF()
   # hide all not-exported symbols
   SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -Wall -std=c++0x" )