aboutsummaryrefslogtreecommitdiff
path: root/Makefile.in
diff options
context:
space:
mode:
authorAndrew Waterman <andrew@sifive.com>2021-07-29 17:42:34 -0700
committerAndrew Waterman <andrew@sifive.com>2021-07-29 17:54:30 -0700
commit13ce3cb1eedb337eee3f45ffdf2e32332a22d50d (patch)
tree4d80456ae228f9d8934b312148972d5b75a9f2e4 /Makefile.in
parent74d3e4d771049884c9d7fd414777efacaddf68f5 (diff)
downloadriscv-isa-sim-13ce3cb1eedb337eee3f45ffdf2e32332a22d50d.zip
riscv-isa-sim-13ce3cb1eedb337eee3f45ffdf2e32332a22d50d.tar.gz
riscv-isa-sim-13ce3cb1eedb337eee3f45ffdf2e32332a22d50d.tar.bz2
Enable precompiled headers when using clangtest
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/Makefile.in b/Makefile.in
index deebc5b..6ef2319 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -38,6 +38,7 @@ scripts_dir := $(src_dir)/scripts
HAVE_INT128 := @HAVE_INT128@
HAVE_DLOPEN := @HAVE_DLOPEN@
+HAVE_CLANG_PCH := @HAVE_CLANG_PCH@
# If the version information is not in the configure script, then we
# assume that we are in a working directory. We use the vcs-version.sh
@@ -219,9 +220,8 @@ $(2)_deps += $$(patsubst %.o, %.d, $$($(2)_c_objs))
$(2)_deps += $$(patsubst %.h, %.h.d, $$($(2)_precompiled_hdrs))
$$($(2)_pch) : %.h.gch : %.h
$(COMPILE) -x c++-header $$< -o $$@
-# If using clang, don't depend (and thus don't build) precompiled headers
-$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs) $(if $(filter-out clang,$(CC)),$$($(2)_pch))
- $(COMPILE) $$($(2)_CFLAGS) -c $$<
+$$($(2)_objs) : %.o : %.cc $$($(2)_gen_hdrs) $$($(2)_pch)
+ $(COMPILE) $(if $(HAVE_CLANG_PCH), $$(if $$($(2)_pch), -include-pch $$($(2)_pch))) $$($(2)_CFLAGS) -c $$<
$$($(2)_c_objs) : %.o : %.c $$($(2)_gen_hdrs)
$(COMPILE_C) $$($(2)_CFLAGS) -c $$<