Permalink
Browse files

remove precompiled header for Mingw :( see http://gcc.gnu.org/bugzill…

  • Loading branch information...
lasconic committed Dec 16, 2013
1 parent ab14241 commit 8f3ed9b4b161c9d2ca503ba6379230e8b9c2c4f1
Showing with 19 additions and 18 deletions.
  1. +6 −2 CMakeLists.txt
  2. +0 −6 all.h
  3. +13 −10 build/CreatePrecompiledHeader.cmake
View
@@ -359,8 +359,12 @@ add_custom_command(
DEPENDS ${PROJECT_SOURCE_DIR}/all.h
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
)
-
-precompiled_header(QT_INCLUDES all)
+if (MINGW)
+ set(BUILD_PCH false)
+else (MINGW)
+ set(BUILD_PCH true)
+endif(MINGW)
+precompiled_header(QT_INCLUDES all ${BUILD_PCH})
ADD_CUSTOM_TARGET(mops1 DEPENDS ${PROJECT_BINARY_DIR}/all.h)
ADD_CUSTOM_TARGET(mops2 DEPENDS ${PCH})
View
6 all.h
@@ -51,11 +51,9 @@
#include <QSharedData>
#include <QAtomicInt>
-#include <QStaticText>
#include <QErrorMessage>
#include <QPainterPath>
-#include <QBitmap>
#include <QPixmap>
#include <QPainter>
#include <QKeyEvent>
@@ -69,7 +67,6 @@
#include <QAbstractTextDocumentLayout>
#include <QTextBlock>
#include <QTextList>
-#include <QTextFrameFormat>
#include <QClipboard>
#include <QPlainTextEdit>
#include <QStyledItemDelegate>
@@ -83,7 +80,6 @@
#include <QScrollArea>
#include <QScrollBar>
#include <QToolBar>
-#include <QWhatsThis>
#include <QTreeWidget>
#include <QFileDialog>
#include <QPrintDialog>
@@ -124,8 +120,6 @@
#include <QStatusBar>
#include <QStylePainter>
#include <QStyleOptionButton>
-#include <QStyleFactory>
-#include <QFileSystemModel>
#include <QHeaderView>
#include <QUndoGroup>
#include <QUndoStack>
@@ -1,4 +1,4 @@
-macro( precompiled_header includes header_name )
+macro( precompiled_header includes header_name build_pch)
if( ${CMAKE_COMPILER_IS_GNUCXX})
message(STATUS "precompiled header generation")
# Get the compiler flags for this build type
@@ -29,18 +29,21 @@ macro( precompiled_header includes header_name )
# Prepare the compile flags var for passing to GCC
separate_arguments( compile_flags )
- set (PCH ${PROJECT_BINARY_DIR}/${header_name}.h.gch)
set (PCH_HEADER "${PROJECT_BINARY_DIR}/${header_name}.h")
set (PCH_INCLUDE "-include ${PCH_HEADER}")
- add_custom_command(
- OUTPUT ${PROJECT_BINARY_DIR}/${header_name}.h.gch
- COMMAND ${CMAKE_CXX_COMPILER}
- -x c++-header -g ${compile_flags} -o ${header_name}.h.gch ${header_name}.h
- DEPENDS ${PROJECT_BINARY_DIR}/${header_name}.h
- WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
- VERBATIM
- )
+ if( ${build_pch} )
+ set (PCH ${PROJECT_BINARY_DIR}/${header_name}.h.gch)
+ add_custom_command(
+ OUTPUT ${PROJECT_BINARY_DIR}/${header_name}.h.gch
+ COMMAND ${CMAKE_CXX_COMPILER} -x c++-header -g ${compile_flags} -o ${header_name}.h.gch ${header_name}.h
+ DEPENDS ${PROJECT_BINARY_DIR}/${header_name}.h
+ WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
+ VERBATIM
+ )
+ else ( ${build_pch} )
+ message(STATUS "No precompiled header")
+ endif( ${build_pch} )
endif()
endmacro()

0 comments on commit 8f3ed9b

Please sign in to comment.