mirror of
https://github.com/status-im/evmc.git
synced 2025-02-23 16:38:06 +00:00
CMake: Build static libs with fPIC when needed
This commit is contained in:
parent
97221d2db7
commit
426ff28d89
@ -12,5 +12,8 @@ add_library(
|
|||||||
add_library(evmc::instructions ALIAS instructions)
|
add_library(evmc::instructions ALIAS instructions)
|
||||||
set_target_properties(instructions PROPERTIES OUTPUT_NAME evmc-instructions)
|
set_target_properties(instructions PROPERTIES OUTPUT_NAME evmc-instructions)
|
||||||
target_include_directories(instructions PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
target_include_directories(instructions PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
||||||
|
if(BUILD_SHARED_LIBS)
|
||||||
|
set_target_properties(instructions PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
install(TARGETS instructions EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
@ -12,5 +12,8 @@ add_library(evmc::loader ALIAS loader)
|
|||||||
set_target_properties(loader PROPERTIES OUTPUT_NAME evmc-loader)
|
set_target_properties(loader PROPERTIES OUTPUT_NAME evmc-loader)
|
||||||
target_include_directories(loader PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
target_include_directories(loader PUBLIC $<BUILD_INTERFACE:${include_dir}>$<INSTALL_INTERFACE:include>)
|
||||||
target_link_libraries(loader INTERFACE ${CMAKE_DL_LIBS})
|
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})
|
install(TARGETS loader EXPORT evmcTargets DESTINATION ${CMAKE_INSTALL_LIBDIR})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user