Build the static library as position independent

This allows it to be compiled into other shared libraries (like the Python
bindings) on x86_64 Linux systems.
This commit is contained in:
Matt Williams 2012-07-19 18:01:31 +01:00
parent ac7962b534
commit 0d1c2e178a
2 changed files with 6 additions and 0 deletions

View File

@ -113,6 +113,9 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
#Build
IF(LIBRARY_TYPE STREQUAL "STATIC")
ADD_LIBRARY(PolyVoxCore STATIC ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})
IF(UNIX)
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF()
ENDIF()
IF(LIBRARY_TYPE STREQUAL "DYNAMIC")
ADD_LIBRARY(PolyVoxCore SHARED ${CORE_SRC_FILES} ${CORE_INC_FILES} ${IMPL_SRC_FILES} ${IMPL_INC_FILES})

View File

@ -31,6 +31,9 @@ LINK_DIRECTORIES(${PolyVoxCore_BINARY_DIR}/debug ${PolyVoxCore_BINARY_DIR}/relea
#Build
IF(LIBRARY_TYPE STREQUAL "STATIC")
ADD_LIBRARY(PolyVoxUtil STATIC ${UTIL_SRC_FILES} ${UTIL_INC_FILES})
IF(UNIX)
SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF()
ENDIF()
IF(LIBRARY_TYPE STREQUAL "DYNAMIC")
ADD_LIBRARY(PolyVoxUtil SHARED ${UTIL_SRC_FILES} ${UTIL_INC_FILES})