1
0
mirror of https://github.com/google/cpu_features.git synced 2025-04-28 15:33:37 +02:00

Use fPIC when building as a shared library

Also include a note stating that the use of shared libraries is
discouraged.
This commit is contained in:
Alex Arslan 2018-02-07 14:39:22 -08:00
parent 8818e6ac6e
commit 6a959dcc1a
No known key found for this signature in database
GPG Key ID: EC409F3AF54AD659

View File

@ -49,6 +49,13 @@ target_include_directories(cpu_features PRIVATE include/internal)
target_compile_definitions(cpu_features PUBLIC STACK_LINE_READER_BUFFER_SIZE=1024) target_compile_definitions(cpu_features PUBLIC STACK_LINE_READER_BUFFER_SIZE=1024)
target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS}) target_link_libraries(cpu_features PUBLIC ${CMAKE_DL_LIBS})
# The use of shared libraries is discouraged.
# For API / ABI compatibility reasons, it is recommended to build and use
# cpu_features in a subdirectory of your project or as an embedded dependency.
if(BUILD_SHARED_LIBS)
set_property(TARGET cpu_features PROPERTY POSITION_INDEPENDENT_CODE ON)
endif()
# #
# program : list_cpu_features # program : list_cpu_features
# #