mirror of
https://github.com/matrix-construct/construct
synced 2024-12-26 15:33:54 +01:00
ircd: Precompile the spirit.h header.
This commit is contained in:
parent
21a62019f2
commit
744438ec49
10 changed files with 35 additions and 20 deletions
|
@ -37,6 +37,7 @@ if BUILD_PCH
|
|||
BUILT_SOURCES = \
|
||||
ircd.h.gch \
|
||||
ircd.pic.h.gch \
|
||||
spirit.h.gch \
|
||||
###
|
||||
endif
|
||||
|
||||
|
@ -47,7 +48,11 @@ ircd.pic.h.gch:
|
|||
cp ircd.h ircd.pic.h
|
||||
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o ircd.pic.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) -DPIC ircd.pic.h
|
||||
|
||||
spirit.h.gch:
|
||||
$(CXX) $(CXXFLAGS) $(AM_CXXFLAGS) -fPIC -o spirit.h.gch $(DEFS) $(CPPFLAGS) $(AM_CPPFLAGS) -DPIC -include ircd.pic.h spirit.h
|
||||
|
||||
clean-local:
|
||||
rm -f ircd.h.gch
|
||||
rm -f ircd.pic.h
|
||||
rm -f ircd.pic.h.gch
|
||||
rm -f spirit.h.gch
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#ifndef HAVE_IRCD_IRCD_H
|
||||
#define HAVE_IRCD_IRCD_H
|
||||
|
||||
// Generated by ./configure
|
||||
|
@ -77,3 +78,5 @@ namespace ircd
|
|||
extern conf::item<bool> read_only;
|
||||
extern conf::item<bool> write_avoid;
|
||||
}
|
||||
|
||||
#endif // HAVE_IRCD_IRCD_H
|
||||
|
|
|
@ -8,14 +8,19 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#pragma once
|
||||
#ifndef HAVE_IRCD_SPIRIT_H
|
||||
#define HAVE_IRCD_SPIRIT_H
|
||||
|
||||
/// This file is not part of the IRCd standard include list (stdinc.h) because
|
||||
/// it involves extremely expensive boost headers for creating formal spirit
|
||||
/// grammars. Include this in a definition file which defines such grammars.
|
||||
|
||||
// ircd.h is included here so that it can be compiled into this header. Then
|
||||
// this becomes the single leading precompiled header.
|
||||
#include <ircd/ircd.h>
|
||||
|
||||
#pragma GCC visibility push(hidden)
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
#include <boost/spirit/include/karma.hpp>
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
|
@ -149,3 +154,5 @@ ircd::spirit::expectation_failure<parent>::expectation_failure(const qi::expecta
|
|||
string_view{e.first, e.first + std::min(std::distance(e.first, e.last), show_max)}
|
||||
}
|
||||
{}
|
||||
|
||||
#endif // HAVE_IRCD_SPIRIT_H
|
||||
|
|
|
@ -161,11 +161,24 @@ endif
|
|||
# This option reduces memory consumption at the cost of compilation speed.
|
||||
if GCC
|
||||
if LOWMEM_COMPILE
|
||||
json.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
http.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
fmt.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
rfc3986.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
rfc1459.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
m_id.lo: CXXFLAGS += --param ggc-min-expand=1
|
||||
LOWMEM_FLAGS= --param ggc-min-expand=1
|
||||
endif
|
||||
endif
|
||||
|
||||
json.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
json.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
||||
http.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
http.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
||||
fmt.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
fmt.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
||||
rfc3986.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
rfc3986.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
||||
rfc1459.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
rfc1459.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
||||
m_id.lo: AM_CPPFLAGS := -include ircd/spirit.h ${AM_CPPFLAGS}
|
||||
m_id.lo: CXXFLAGS += ${LOWMEM_FLAGS}
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd { namespace fmt
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd { namespace http
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
|
|
|
@ -8,9 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
#include <boost/fusion/include/at.hpp>
|
||||
|
||||
namespace ircd { namespace json
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd::m
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd::rfc1459
|
||||
{
|
||||
using namespace ircd::spirit;
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
// copyright notice and this permission notice is present in all copies. The
|
||||
// full license for this software is available in the LICENSE file.
|
||||
|
||||
#include <ircd/spirit.h>
|
||||
|
||||
namespace ircd { namespace rfc3986
|
||||
__attribute__((visibility("hidden")))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue