[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.
|
- Refactoring of code that uses vectors.
|
||||||
- Add target export in cmake.
|
- Add target export in cmake.
|
||||||
- Add option `FORT_ENABLE_TESTING` to turn on/off building tests and examples.
|
- Add option `FORT_ENABLE_TESTING` to turn on/off building tests and examples.
|
||||||
|
- Add option `POSITION_INDEPENDENT_CODE` for library target (libfort::fort).
|
||||||
|
|
||||||
### Docs
|
### Docs
|
||||||
|
|
||||||
|
@ -11,8 +11,11 @@ target_include_directories(fort
|
|||||||
)
|
)
|
||||||
|
|
||||||
set_target_properties(fort
|
set_target_properties(fort
|
||||||
PROPERTIES VERSION ${libfort_VERSION}
|
PROPERTIES
|
||||||
SOVERSION ${libfort_SOVERSION})
|
VERSION ${libfort_VERSION}
|
||||||
|
SOVERSION ${libfort_SOVERSION}
|
||||||
|
POSITION_INDEPENDENT_CODE ON
|
||||||
|
)
|
||||||
|
|
||||||
if(NOT FORT_HAVE_WCHAR)
|
if(NOT FORT_HAVE_WCHAR)
|
||||||
target_compile_definitions(fort
|
target_compile_definitions(fort
|
||||||
|
@ -30,9 +30,14 @@ add_library(foo-lib
|
|||||||
target_link_libraries(foo-lib
|
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)
|
include(GNUInstallDirs)
|
||||||
install(
|
install(
|
||||||
TARGETS foo-lib
|
TARGETS foo-lib foo-lib-shared
|
||||||
EXPORT ${PROJECT_NAME}-targets
|
EXPORT ${PROJECT_NAME}-targets
|
||||||
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||||
|
Loading…
Reference in New Issue
Block a user