Use POSITION_INDEPENDENT_CODE property for CMake >= 2.8.9.

This resolves bug 2985.

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/3/head
Slávek Banko 6 years ago
parent f87cec4baa
commit e5b3a250fc
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -773,7 +773,11 @@ macro( tde_add_library _arg_target )
# set -fPIC flag for static libraries # set -fPIC flag for static libraries
if( _static_pic ) if( _static_pic )
set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC ) if( "${CMAKE_VERSION}" VERSION_LESS "2.8.9" )
set_target_properties( ${_target} PROPERTIES COMPILE_FLAGS -fPIC )
else( )
set_target_properties( ${_target} PROPERTIES POSITION_INDEPENDENT_CODE ON )
endif( )
endif( _static_pic ) endif( _static_pic )
# set version # set version

Loading…
Cancel
Save