Browse Source

Added -fPIC for Linux build. This is needed for linking Polycore into the shared module libraries.

Cameron Hart 14 years ago
parent
commit
cc2ff4cdc3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      Core/Contents/CMakeLists.txt

+ 4 - 0
Core/Contents/CMakeLists.txt

@@ -202,6 +202,10 @@ ELSEIF(APPLE)
 ELSE(MSVC)
     SET(polycore_SRCS ${polycore_SRCS} ../Build/Linux/PolycodeView.cpp Source/PolySDLCore.cpp)
     SET(polycore_HDRS ${polycore_HDRS} ../Build/Linux/PolycodeView.h Include/PolySDLCore.h)
+    # Needs fpic to link in shared lib on Linux
+    IF(CMAKE_COMPILER_IS_GNUCXX)
+		LIST(APPEND CMAKE_CXX_FLAGS -fPIC)
+    ENDIF(CMAKE_COMPILER_IS_GNUCXX)
 ENDIF(MSVC)
 
 #IF(POLYCODE_BUILD_SHARED)