From e74ce01b7f0920026502824922cfd71fca5eb525 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Wed, 12 Jun 2024 10:50:07 -0400 Subject: [PATCH] Fix precompiled headers building with clang Since 24.05 (I think) we need to pass `-c` or Clang thinks we want to compile *both* a final executable and precompiled header file, and complains that we cannot use `-o` with multiple outputs. `-c` seems fine with GCC too, so I just put it in there conditionally. --- mk/precompiled-headers.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mk/precompiled-headers.mk b/mk/precompiled-headers.mk index cdd3daecd..f2803eb79 100644 --- a/mk/precompiled-headers.mk +++ b/mk/precompiled-headers.mk @@ -8,7 +8,7 @@ GCH = $(buildprefix)precompiled-headers.h.gch $(GCH): precompiled-headers.h @rm -f $@ @mkdir -p "$(dir $@)" - $(trace-gen) $(CXX) -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) $(GCH_CXXFLAGS) + $(trace-gen) $(CXX) -c -x c++-header -o $@ $< $(GLOBAL_CXXFLAGS) $(GCH_CXXFLAGS) clean-files += $(GCH)