summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-02-07 19:07:49 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-10 19:21:24 +0100
commit1406659948c226ef663e9dca7728958b9ad5023c (patch)
tree1394ec72ae33d393584428ef9b1c40de44e844e8
parent38257651b7e2085ae66c1c67ee9e33e93587b573 (diff)
Add -fPIE to the Qt5Core_COMPILE_FLAGS with reduce-relocations.
Qt requires this since 482d96a0c5d523ace63f56bda6851926b4469dd0 Change-Id: Iba783e283b17654abf46f11b81cc1641c3ce7d83 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Clinton Stimpson <clinton@elemtech.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
-rw-r--r--mkspecs/features/create_cmake.prf2
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in4
-rw-r--r--tests/manual/cmake/pass1/CMakeLists.txt1
3 files changed, 7 insertions, 0 deletions
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index e52e65c06f..fe1fe4c376 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -31,6 +31,8 @@ CMAKE_RELATIVE_INSTALL_DIR = "../../../"
static|staticlib:CMAKE_STATIC_TYPE = true
+contains(QT_CONFIG, reduce_relocations):CMAKE_ADD_FPIE_FLAGS = "true"
+
macx {
CONFIG(qt_framework, qt_framework|qt_no_framework) {
CMAKE_LIB_FILE_LOCATION_DEBUG = Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}.framework/Qt$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 23a026e615..057c8ff75e 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -7,3 +7,7 @@ set(QT_MOC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/moc$$CMAK
set(QT_RCC_EXECUTABLE \"${_qt5_corelib_install_prefix}/$$CMAKE_BIN_DIR/rcc$$CMAKE_BIN_SUFFIX\")
list(APPEND Qt5Core_INCLUDE_DIRS \"${_qt5_corelib_install_prefix}/mkspecs/default\")
+
+if (NOT \"$${CMAKE_ADD_FPIE_FLAGS}\" STREQUAL \"\")
+ set(Qt5Core_COMPILE_FLAGS "-fPIE")
+endif()
diff --git a/tests/manual/cmake/pass1/CMakeLists.txt b/tests/manual/cmake/pass1/CMakeLists.txt
index f11887e545..b1922c075b 100644
--- a/tests/manual/cmake/pass1/CMakeLists.txt
+++ b/tests/manual/cmake/pass1/CMakeLists.txt
@@ -18,6 +18,7 @@ macro(qt5_use_package _target _package)
# set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${Qt5${_package}_INCLUDE_DIRS})
include_directories(${Qt5${_package}_INCLUDE_DIRS})
set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${Qt5${_package}_COMPILE_DEFINITIONS})
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_FLAGS ${Qt5${_package}_COMPILE_FLAGS})
else()
message(FATAL_ERROR "NOT FOUND: Qt5${_package}")
endif()