summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2017-04-06 02:14:35 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-20 12:59:07 (GMT)
commit0903531964cff8888dd1cbf2a9c82ac6bb9a522f (patch)
tree2cf7d844d3ee291ecb5ba77547bddb0a490aa150 /Modules/Platform
parent135611176c5d4958b9b5a36c63fada8a9e4fb1ef (diff)
downloadCMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.zip
CMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.tar.gz
CMake-0903531964cff8888dd1cbf2a9c82ac6bb9a522f.tar.bz2
Autogen: Pass explicit predefines header to moc if possible
Qt is relying on whoever calls moc to include a file with the predefined values that will be used by the compiler, otherwise moc takes wrong paths and weird things happen. Instead, generate an include file and feed it to all mocs to make sure it's generating correct code. Co-Author: Sebastian Holtermann <sebholt@xwmw.org> Fixes: #16640
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/Linux-GNU.cmake1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/Platform/Linux-GNU.cmake b/Modules/Platform/Linux-GNU.cmake
index 6878254..ce30a26 100644
--- a/Modules/Platform/Linux-GNU.cmake
+++ b/Modules/Platform/Linux-GNU.cmake
@@ -12,4 +12,5 @@ macro(__linux_compiler_gnu lang)
# We pass this for historical reasons. Projects may have
# executables that use dlopen but do not set ENABLE_EXPORTS.
set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-rdynamic")
+ set(CMAKE_${lang}_COMPILER_PREDEFINES_COMMAND "${CMAKE_${lang}_COMPILER}" "-dM" "-E" "-c" "${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp")
endmacro()