mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
implement PCH build option for components
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
45ea98a506
commit
c6d001882d
18 changed files with 92 additions and 1 deletions
|
@ -150,6 +150,9 @@ add_feature_info(utils KATIE_UTILS "build maintainance utilities")
|
|||
option(KATIE_ALLINONE "Build targets from single source file" OFF)
|
||||
add_feature_info(allinone KATIE_ALLINONE "build targets from single source file")
|
||||
|
||||
option(KATIE_PCH "Build components with pre-compiled header" OFF)
|
||||
add_feature_info(pch KATIE_PCH "build components with pre-compiled header")
|
||||
|
||||
option(WITH_ACCESSIBILITY "Build accessibility support" ON)
|
||||
add_feature_info(accessibility WITH_ACCESSIBILITY "build accessibility support")
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ build_script:
|
|||
|
||||
export CXXFLAGS="$CXXFLAGS -w"
|
||||
|
||||
cmake . -Wno-dev -DKATIE_TESTS=ON -DKATIE_BENCHMARKS=ON -DKATIE_UTILS=ON -DKATIE_ALLINONE=ON
|
||||
cmake . -Wno-dev -DKATIE_TESTS=ON -DKATIE_BENCHMARKS=ON -DKATIE_UTILS=ON -DKATIE_ALLINONE=ON -DKATIE_PCH=ON
|
||||
|
||||
make -j $(nproc || echo 1)
|
||||
|
||||
|
|
|
@ -320,6 +320,17 @@ macro(KATIE_SETUP_OBJECT FORTARGET)
|
|||
endforeach()
|
||||
endmacro()
|
||||
|
||||
# a macro to setup pre-compiled header for target
|
||||
macro(KATIE_SETUP_PCH FORTARGET)
|
||||
if(KATIE_PCH)
|
||||
if (NOT CMAKE_VERSION VERSION_LESS "3.16.0")
|
||||
target_precompile_headers(${FORTARGET} PRIVATE "${CMAKE_SOURCE_DIR}/src/core/qt_pch.h")
|
||||
else()
|
||||
message(FATAL_ERROR "Pre-compiled headers option requires CMake v3.16+")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
# a macro to remove conditional code from headers which is only relevant to the
|
||||
# process of building Katie itself
|
||||
macro(KATIE_OPTIMIZE_HEADERS DIR)
|
||||
|
|
|
@ -461,6 +461,8 @@ set_target_properties(KtCore PROPERTIES
|
|||
EXPORT_NAME Core
|
||||
)
|
||||
|
||||
katie_setup_pch(KtCore)
|
||||
|
||||
install(
|
||||
TARGETS KtCore
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
51
src/core/qt_pch.h
Normal file
51
src/core/qt_pch.h
Normal file
|
@ -0,0 +1,51 @@
|
|||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2015 The Qt Company Ltd.
|
||||
** Copyright (C) 2016-2020 Ivailo Monev
|
||||
**
|
||||
** This file is part of the QtCore module of the Katie Toolkit.
|
||||
**
|
||||
** $QT_BEGIN_LICENSE:LGPL$
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
** This file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** As a special exception, The Qt Company gives you certain additional
|
||||
** rights. These rights are described in The Qt Company LGPL Exception
|
||||
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
||||
**
|
||||
** GNU General Public License Usage
|
||||
** Alternatively, this file may be used under the terms of the GNU
|
||||
** General Public License version 3.0 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU General Public License version 3.0 requirements will be
|
||||
** met: http://www.gnu.org/copyleft/gpl.html.
|
||||
**
|
||||
** $QT_END_LICENSE$
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef QT_PCH_H
|
||||
#define QT_PCH_H
|
||||
|
||||
#if defined __cplusplus
|
||||
# include "qplatformdefs.h"
|
||||
# include "qcoreapplication.h"
|
||||
# include "qlist.h"
|
||||
# include "qvariant.h"
|
||||
# include "qobject.h"
|
||||
# include "qregexp.h"
|
||||
# include "qstring.h"
|
||||
# include "qstringlist.h"
|
||||
# include "qtextcodec.h"
|
||||
#else
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#endif
|
|
@ -109,6 +109,8 @@ set_target_properties(KtDBus PROPERTIES
|
|||
EXPORT_NAME DBus
|
||||
)
|
||||
|
||||
katie_setup_pch(KtDBus)
|
||||
|
||||
install(
|
||||
TARGETS KtDBus
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -335,6 +335,8 @@ set_target_properties(KtDeclarative PROPERTIES
|
|||
EXPORT_NAME Declarative
|
||||
)
|
||||
|
||||
katie_setup_pch(KtDeclarative)
|
||||
|
||||
install(
|
||||
TARGETS KtDeclarative
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -291,6 +291,7 @@ set_target_properties(KtDesigner PROPERTIES
|
|||
)
|
||||
|
||||
katie_setup_object(KtDesigner sharedqtgradienteditor sharedqtpropertybrowser sharedfindwidget)
|
||||
katie_setup_pch(KtDesigner)
|
||||
|
||||
install(
|
||||
TARGETS KtDesigner
|
||||
|
|
|
@ -226,6 +226,7 @@ set_target_properties(KtDesignerComponents PROPERTIES
|
|||
)
|
||||
|
||||
katie_setup_object(KtDesignerComponents sharedfindwidget sharedqtpropertybrowser sharedqtgradienteditor)
|
||||
katie_setup_pch(KtDesignerComponents)
|
||||
|
||||
install(
|
||||
TARGETS KtDesignerComponents
|
||||
|
|
|
@ -1056,6 +1056,8 @@ set_target_properties(KtGui PROPERTIES
|
|||
EXPORT_NAME Gui
|
||||
)
|
||||
|
||||
katie_setup_pch(KtGui)
|
||||
|
||||
install(
|
||||
TARGETS KtGui
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -226,6 +226,8 @@ set_target_properties(KtNetwork PROPERTIES
|
|||
EXPORT_NAME Network
|
||||
)
|
||||
|
||||
katie_setup_pch(KtNetwork)
|
||||
|
||||
install(
|
||||
TARGETS KtNetwork
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -244,6 +244,8 @@ set_target_properties(KtScript PROPERTIES
|
|||
EXPORT_NAME Script
|
||||
)
|
||||
|
||||
katie_setup_pch(KtScript)
|
||||
|
||||
install(
|
||||
TARGETS KtScript
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -181,6 +181,8 @@ set_target_properties(KtScriptTools PROPERTIES
|
|||
EXPORT_NAME ScriptTools
|
||||
)
|
||||
|
||||
katie_setup_pch(KtScriptTools)
|
||||
|
||||
install(
|
||||
TARGETS KtScriptTools
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -81,6 +81,8 @@ set_target_properties(KtSql PROPERTIES
|
|||
EXPORT_NAME Sql
|
||||
)
|
||||
|
||||
katie_setup_pch(KtSql)
|
||||
|
||||
install(
|
||||
TARGETS KtSql
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -63,6 +63,8 @@ set_target_properties(KtSvg PROPERTIES
|
|||
EXPORT_NAME Svg
|
||||
)
|
||||
|
||||
katie_setup_pch(KtSvg)
|
||||
|
||||
install(
|
||||
TARGETS KtSvg
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -108,6 +108,8 @@ set_target_properties(KtTest PROPERTIES
|
|||
EXPORT_NAME Test
|
||||
)
|
||||
|
||||
katie_setup_pch(KtTest)
|
||||
|
||||
install(
|
||||
TARGETS KtTest
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -57,6 +57,8 @@ set_target_properties(KtUiTools PROPERTIES
|
|||
EXPORT_NAME UiTools
|
||||
)
|
||||
|
||||
katie_setup_pch(KtUiTools)
|
||||
|
||||
install(
|
||||
TARGETS KtUiTools
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
|
@ -41,6 +41,8 @@ set_target_properties(KtXml PROPERTIES
|
|||
EXPORT_NAME Xml
|
||||
)
|
||||
|
||||
katie_setup_pch(KtXml)
|
||||
|
||||
install(
|
||||
TARGETS KtXml
|
||||
EXPORT KatieTargets ${INSTALL_TARGETS_DEFAULT_ARGS}
|
||||
|
|
Loading…
Add table
Reference in a new issue