summaryrefslogtreecommitdiffstats
path: root/Tests/PositionIndependentTargets
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-05-14 09:42:34 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-05-14 14:40:53 (GMT)
commit929c8a7860344b0b2edeefaf09be1ef0b09f4b23 (patch)
treea5933ca4e2f27e618240e73af10972a35bf0cf5b /Tests/PositionIndependentTargets
parent21da0f83a21794bdd283210608ca7c127db084ec (diff)
downloadCMake-929c8a7860344b0b2edeefaf09be1ef0b09f4b23.zip
CMake-929c8a7860344b0b2edeefaf09be1ef0b09f4b23.tar.gz
CMake-929c8a7860344b0b2edeefaf09be1ef0b09f4b23.tar.bz2
INTERFACE_POSITION_INDEPENDENT_CODE must be transitive for OBJECT library
Fixes: #22174
Diffstat (limited to 'Tests/PositionIndependentTargets')
-rw-r--r--Tests/PositionIndependentTargets/interface/CMakeLists.txt3
1 files changed, 3 insertions, 0 deletions
diff --git a/Tests/PositionIndependentTargets/interface/CMakeLists.txt b/Tests/PositionIndependentTargets/interface/CMakeLists.txt
index 65f3b76..90186a3 100644
--- a/Tests/PositionIndependentTargets/interface/CMakeLists.txt
+++ b/Tests/PositionIndependentTargets/interface/CMakeLists.txt
@@ -12,6 +12,9 @@ set_property(TARGET sharedlib PROPERTY DEFINE_SYMBOL PIC_TEST_BUILD_DLL)
add_executable(test_iface_via_shared "${CMAKE_CURRENT_SOURCE_DIR}/../pic_main.cpp")
target_link_libraries(test_iface_via_shared sharedlib)
+add_library(objectlib OBJECT "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp")
+target_link_libraries(objectlib piciface)
+
add_library(sharedlibpic SHARED "${CMAKE_CURRENT_SOURCE_DIR}/../pic_lib.cpp")
set_property(TARGET sharedlibpic PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE ON)
set_property(TARGET sharedlibpic PROPERTY DEFINE_SYMBOL PIC_TEST_BUILD_DLL)