More reliable way of adding -fPIC.

Fixes #162
This commit is contained in:
Strahinja Val Markovic 2013-02-27 19:43:41 -08:00
parent 263b405ab4
commit 719b497daa
2 changed files with 5 additions and 7 deletions

View File

@ -107,7 +107,7 @@ endif()
############################################################################# #############################################################################
# Linking fails without this # Linking fails without this
if( NOT WIN32 AND CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" ) if( NOT WIN32 AND 64_BIT_PLATFORM )
set_target_properties( BoostParts PROPERTIES COMPILE_FLAGS "-fPIC") set_target_properties( BoostParts PROPERTIES COMPILE_FLAGS "-fPIC")
endif() endif()

View File

@ -83,12 +83,10 @@ else()
endif() endif()
# Check if platform is 64 bit # Check if platform is 64 bit
if( NOT APPLE ) if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( 64_BIT_PLATFORM 0 ) set( 64_BIT_PLATFORM 0 )
else() else()
set( 64_BIT_PLATFORM 1 ) set( 64_BIT_PLATFORM 1 )
endif()
endif() endif()
add_subdirectory( BoostParts ) add_subdirectory( BoostParts )