loader: Always build with PIC
@@ -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})
