Set "position independent code" property unconditionally in os, util
Previously it wasn't set for all platforms, breaking, e.g., Linux on ARM. The property also does the trick for OpenIndiana, so that hack can be removed as well Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
0db99fbf4e
commit
cef4a51810
2 changed files with 3 additions and 15 deletions
|
@ -19,10 +19,7 @@ add_library(util ${srcs_util})
|
|||
generate_export_header(util EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/exports/util/ut_export.h")
|
||||
target_link_libraries(util PUBLIC OSAPI)
|
||||
|
||||
if("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64")
|
||||
# Shared libs will have this by default. Static libs need it too on x86_64.
|
||||
set_property(TARGET util PROPERTY POSITION_INDEPENDENT_CODE TRUE)
|
||||
endif()
|
||||
set_property(TARGET util PROPERTY POSITION_INDEPENDENT_CODE TRUE)
|
||||
|
||||
target_include_directories(
|
||||
util PUBLIC
|
||||
|
@ -31,10 +28,6 @@ target_include_directories(
|
|||
"$<INSTALL_INTERFACE:${INSTALL_PREFIX}/include/>"
|
||||
"$<INSTALL_INTERFACE:${INSTALL_PREFIX}/exports/>")
|
||||
|
||||
if(${CMAKE_C_COMPILER_ID} STREQUAL "SunPro")
|
||||
add_definitions(-KPIC)
|
||||
endif()
|
||||
|
||||
# TODO: improve test inclusion.
|
||||
if((BUILD_TESTING) AND ((NOT DEFINED MSVC_VERSION) OR (MSVC_VERSION GREATER "1800")))
|
||||
add_subdirectory(tests)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue