[A] Add option POSITION_INDEPENDENT_CODE
for library target (libfort::fort).
This commit is contained in:
parent
7a8e267e9e
commit
90265dd628
@ -17,6 +17,7 @@
|
||||
- Refactoring of code that uses vectors.
|
||||
- Add target export in cmake.
|
||||
- Add option `FORT_ENABLE_TESTING` to turn on/off building tests and examples.
|
||||
- Add option `POSITION_INDEPENDENT_CODE` for library target (libfort::fort).
|
||||
|
||||
### Docs
|
||||
|
||||
|
@ -11,8 +11,11 @@ target_include_directories(fort
|
||||
)
|
||||
|
||||
set_target_properties(fort
|
||||
PROPERTIES VERSION ${libfort_VERSION}
|
||||
SOVERSION ${libfort_SOVERSION})
|
||||
PROPERTIES
|
||||
VERSION ${libfort_VERSION}
|
||||
SOVERSION ${libfort_SOVERSION}
|
||||
POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
|
||||
if(NOT FORT_HAVE_WCHAR)
|
||||
target_compile_definitions(fort
|
||||
|
@ -28,11 +28,16 @@ target_link_libraries(foo-app
|
||||
add_library(foo-lib
|
||||
foo-lib.cpp)
|
||||
target_link_libraries(foo-lib
|
||||
PRIVATE libfort::fort)
|
||||
PRIVATE libfort::fort)
|
||||
|
||||
add_library(foo-lib-shared SHARED
|
||||
foo-lib.cpp)
|
||||
target_link_libraries(foo-lib-shared
|
||||
PRIVATE libfort::fort)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
install(
|
||||
TARGETS foo-lib
|
||||
TARGETS foo-lib foo-lib-shared
|
||||
EXPORT ${PROJECT_NAME}-targets
|
||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
|
Loading…
Reference in New Issue
Block a user