forked from qt-creator/qt-creator
CMake build: Force -fPIC for static libraries on UNIX
Usually that is done by Qt, but not if reduce_relocations is off. Fixes: QTCREATORBUG-26435 Change-Id: Idd337d59555fd6e732215b9c753820672f63c91f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Christophe Giboudeaux <christophe@krop.fr> Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This commit is contained in:
@@ -203,6 +203,11 @@ function(add_qtc_library name)
|
|||||||
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
set(TEST_DEFINES WITH_TESTS SRCDIR="${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(_arg_STATIC AND UNIX)
|
||||||
|
# not added by Qt if reduce_relocations is turned off for it
|
||||||
|
set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||||
|
endif()
|
||||||
|
|
||||||
extend_qtc_target(${name}
|
extend_qtc_target(${name}
|
||||||
INCLUDES ${_arg_INCLUDES}
|
INCLUDES ${_arg_INCLUDES}
|
||||||
PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES}
|
PUBLIC_INCLUDES ${_arg_PUBLIC_INCLUDES}
|
||||||
|
Reference in New Issue
Block a user