summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorCristian Adam <cristian.adam@qt.io>2023-05-12 13:18:35 +0200
committerCristian Adam <cristian.adam@qt.io>2023-05-12 12:49:05 +0000
commit0dbc208a070812de867cec27c960ed7de31e8bf7 (patch)
tree1223156047efd15361c0f588a6ba8582ad3e17e6 /cmake
parentfc8ae0e2dc011e59792cc6d68841e24643138b16 (diff)
downloadqt-creator-0dbc208a070812de867cec27c960ed7de31e8bf7.tar.gz
CMake: Add -fPIC also for OBJECT libraries
add_qtc_library would have set the POSITION_INDEPENDENT_CODE property for STATIC libraries on UNIX based systems. The OBJECT libraries need the same treatment. Change-Id: Ia333a36ea0f35d7db3ed876cdde5b895b47644c7 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtCreatorAPI.cmake2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmake/QtCreatorAPI.cmake b/cmake/QtCreatorAPI.cmake
index a50e9be59f..effbb45404 100644
--- a/cmake/QtCreatorAPI.cmake
+++ b/cmake/QtCreatorAPI.cmake
@@ -188,7 +188,7 @@ function(add_qtc_library name)
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
endif()
- if(_arg_STATIC AND UNIX)
+ if((_arg_STATIC OR _arg_OBJECT) AND UNIX)
# not added by Qt if reduce_relocations is turned off for it
set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
endif()