diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-28 21:20:55 +0200 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2015-05-29 00:08:41 +0000 |
commit | e3983c87280ade48b243d9c60bed639713851be9 (patch) | |
tree | c370ee7f6fb9ffaad46501e89b528ed4a0558991 /src/corelib/Qt5CoreConfigExtras.cmake.in | |
parent | 95b6c4fed6521aa2212cab67cb8a6e5553e86117 (diff) |
Revert some changes in light of GCC 4 -fPIE reversalv5.4.2
The -fPIE option is now accepted when using GCC 4, which means it
is available for backward compatibility for clients using
CMake 2.8.11 or older which makes use of the
POSITION_INDEPENDENT_CODE feature.
Conditionally use that feature for old versions of cmake with
GCC 4. Restore the tests for those versions, and clarify the
situation in the ChangeLog.
Change-Id: I5a06b155dda7db559d86841a2b34fd8ed95acbd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/Qt5CoreConfigExtras.cmake.in')
-rw-r--r-- | src/corelib/Qt5CoreConfigExtras.cmake.in | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in index a5cab880ba..65fd1f9383 100644 --- a/src/corelib/Qt5CoreConfigExtras.cmake.in +++ b/src/corelib/Qt5CoreConfigExtras.cmake.in @@ -71,7 +71,13 @@ set(_qt5_corelib_extra_includes) # macro to add it. set(Qt5_POSITION_INDEPENDENT_CODE True) set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\") -set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) +if (CMAKE_VERSION VERSION_LESS 2.8.12 + AND (NOT CMAKE_CXX_COMPILER_ID STREQUAL \"GNU\" + OR CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.0)) + set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\") +else() + set_property(TARGET Qt5::Core APPEND PROPERTY INTERFACE_COMPILE_OPTIONS $$QMAKE_CXXFLAGS_APP) +endif() !!IF !isEmpty(QT_NAMESPACE) list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE) |