1
0
Fork 0
mirror of https://github.com/KingDuckZ/dindexer.git synced 2024-11-25 00:53:43 +00:00

Use a compiler-independent way to say -fPIC

This commit is contained in:
King_DuckZ 2017-03-19 21:45:13 +00:00
parent 9d24a108d8
commit 23098c9fe0
2 changed files with 8 additions and 2 deletions

View file

@ -36,5 +36,8 @@ target_link_libraries(${PROJECT_NAME}
#see https://cmake.org/pipermail/cmake/2007-May/014350.html
#and http://stackoverflow.com/questions/6093547/what-do-r-x86-64-32s-and-r-x86-64-64-relocation-mean/6093910#6093910
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
#see https://github.com/CarloWood/cmaketest/blob/master/bar.cmake
set_target_properties(${PROJECT_NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON #Compile this object code position independent.
)
endif()

View file

@ -32,5 +32,8 @@ target_compile_features(${PROJECT_NAME}
#see https://cmake.org/pipermail/cmake/2007-May/014350.html
#and http://stackoverflow.com/questions/6093547/what-do-r-x86-64-32s-and-r-x86-64-64-relocation-mean/6093910#6093910
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" )
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-fPIC")
#see https://github.com/CarloWood/cmaketest/blob/master/bar.cmake
set_target_properties(${PROJECT_NAME} PROPERTIES
POSITION_INDEPENDENT_CODE ON #Compile this object code position independent.
)
endif()