forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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()
|
||||
|
1
src/libs/3rdparty/cplusplus/CMakeLists.txt
vendored
1
src/libs/3rdparty/cplusplus/CMakeLists.txt
vendored
@@ -41,7 +41,6 @@ add_qtc_library(3rd_cplusplus OBJECT
|
||||
TypeVisitor.cpp TypeVisitor.h
|
||||
cppassert.h
|
||||
SKIP_PCH
|
||||
PROPERTIES POSITION_INDEPENDENT_CODE ON
|
||||
)
|
||||
|
||||
set(export_symbol_declaration DEFINES CPLUSPLUS_BUILD_LIB)
|
||||
|
@@ -1,5 +1,5 @@
|
||||
add_qtc_library(SqliteC OBJECT
|
||||
PROPERTIES AUTOMOC OFF AUTOUIC OFF QT_COMPILE_OPTIONS_DISABLE_WARNINGS ON POSITION_INDEPENDENT_CODE ON
|
||||
PROPERTIES AUTOMOC OFF AUTOUIC OFF QT_COMPILE_OPTIONS_DISABLE_WARNINGS ON
|
||||
DEFINES SQLITE_CORE SQLITE_CUSTOM_INCLUDE=config.h $<$<CONFIG:Debug>:SQLITE_DEBUG>
|
||||
PROPERTIES COMPILE_OPTIONS $<IF:$<CXX_COMPILER_ID:MSVC>,/FIconfig.h,-includeconfig.h>
|
||||
PUBLIC_INCLUDES
|
||||
|
Reference in New Issue
Block a user