loader: Always build with PIC

This commit is contained in:
Paweł Bylica 2018-08-21 09:07:03 +02:00
parent 6962e6a302
commit 17fe768522
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
1 changed files with 7 additions and 5 deletions

View File

@ -9,11 +9,13 @@ add_library(
)
add_library(evmc::loader ALIAS loader)
set_target_properties(loader PROPERTIES OUTPUT_NAME evmc-loader)
target_include_directories(loader PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
set_target_properties(loader PROPERTIES
OUTPUT_NAME evmc-loader
POSITION_INDEPENDENT_CODE TRUE
)
target_include_directories(loader PUBLIC
$<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)
target_link_libraries(loader INTERFACE ${CMAKE_DL_LIBS})
if(BUILD_SHARED_LIBS)
set_target_properties(loader PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
endif()
install(TARGETS loader EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})