[CMake] Use POSITION_INDEPENDENT_CODE property instead of manually setting -fPIC (Alchemy sync)

This commit is contained in:
Router Gray
2019-12-20 16:19:21 -06:00
parent 6608dd0b8d
commit 0496374328
9 changed files with 18 additions and 60 deletions

View File

@@ -269,12 +269,6 @@ list(APPEND llcommon_SOURCE_FILES ${cwdebug_SOURCE_FILES})
list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
if(NOT WORD_SIZE EQUAL 32)
if(NOT WINDOWS)
add_definitions(-fPIC)
endif(NOT WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
if(LLCOMMON_LINK_SHARED)
add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
if(WINDOWS)
@@ -286,6 +280,8 @@ else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
endif(LLCOMMON_LINK_SHARED)
set_target_properties(llcommon PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
target_link_libraries(
llcommon
PUBLIC