diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-07-17 12:05:58 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-07-17 13:30:55 +0200 |
commit | d60dc145adf15cf9d06ea191dfd4b2f4c5c3fc33 (patch) | |
tree | 3fbb63f8f5c8bbe509016c1d90ac82a2fca2eb35 /configure.ac | |
parent | 621514cf1dbb089a6da35da7f8c43d0a3c645fa7 (diff) |
use Clang11's -fpch-instantiate-templates if available
The optimization to instantiate templates already while creating
the PCH instead for every single compilation has been finally
accepted upstream, but it's opt-in.
Change-Id: Ia6456df05512329fc594f9ed0e400250c4f5029e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/98948
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 7dae274f3e43..9e206cc303d0 100644 --- a/configure.ac +++ b/configure.ac @@ -5317,6 +5317,22 @@ if test -n "$ENABLE_PCH" -a -n "$CCACHE_DEPEND_MODE" -a "$GCC" = "yes" -a "$COM_ fi fi +PCH_INSTANTIATE_TEMPLATES= +if test -n "$ENABLE_PCH"; then + AC_MSG_CHECKING([whether $CC supports -fpch-instantiate-templates]) + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror -fpch-instantiate-templates" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ return 0; ]])],[ PCH_INSTANTIATE_TEMPLATES="-fpch-instantiate-templates" ],[]) + CFLAGS=$save_CFLAGS + if test -n "$PCH_INSTANTIATE_TEMPLATES"; then + AC_MSG_RESULT(yes) + else + AC_MSG_RESULT(no) + fi + CFLAGS=$save_CFLAGS +fi +AC_SUBST(PCH_INSTANTIATE_TEMPLATES) + BUILDING_PCH_WITH_OBJ= if test -n "$ENABLE_PCH"; then AC_MSG_CHECKING([whether $CC supports -Xclang -building-pch-with-obj]) |