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:
parent
8818e6ac6e
commit
6a959dcc1a
@ -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
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user