[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a60c106c 07/13: Use clang's preprocessor
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a60c106c 07/13: Use clang's preprocessor |
Date: |
Mon, 21 Nov 2022 17:29:18 -0500 (EST) |
branch: master
commit a60c106c00e3f31ea2fe227bafe59ca5bf20e980
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Use clang's preprocessor
The preprocessor, traditionally $CPP, is not explicitly used by any lmi
makefile; therefore, it is unspecified for clang.
The technique lmi uses to generate autodependency files relies on the
-MMD -MP -MT -MF
options of the gcc preprocessor, which is invoked as $GNU_CPP even with
compilers incompatible with gcc that lack those options; but clang's
preprocessor deliberately supports those options for compatibility with
gcc's; therefore, it is used for that purpose.
Clang provides a separate 'clang-cpp-*' preprocessor, but at least in
debian it's versioned: e.g., 'clang-cpp-13' exists today in 'bookworm',
but there's no generic 'clang-cpp'. Therefore, '$(CXX) -E' is used here,
on the assumption that the C++ compiler's preprocessor works correctly
for C source files (at least for autodependencies).
---
compiler_clang_version.make | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/compiler_clang_version.make b/compiler_clang_version.make
index da60f7f1..ac67fb7e 100644
--- a/compiler_clang_version.make
+++ b/compiler_clang_version.make
@@ -27,7 +27,7 @@ $(srcdir)/compiler_clang_version.make:: ;
AR := ar
CC := clang
-CPP := cpp
+#CPP # Not used.
CXX := clang++
LD := clang++
# For GNU/Linux, $(RC) is never invoked.
@@ -42,5 +42,5 @@ RC := windres
# Override these definitions to specify GNU tools when using an
# incompatible toolchain.
-GNU_CPP := $(CPP)
+GNU_CPP := $(CXX) -E
GNU_CXX := $(CXX)
- [lmi-commits] [lmi] master c6528973 06/13: Specify all '*FLAGS' in one place, (continued)
- [lmi-commits] [lmi] master c6528973 06/13: Specify all '*FLAGS' in one place, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 93e400db 10/13: Avoid literal '***' in a 'set -vx' script, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 8cb31fd7 01/13: Record gcc version eleven pc-linux-gnu speed for commit 5a4fcaed7, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 1a7a1e59 12/13: Use libc++ rather than libstdc++ with clang, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master b830f9a0 04/13: Record speed measurements, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 4b6b2b5c 05/13: Split long lines that will soon become longer, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master d6c7ec7a 08/13: Build and install libraries for all toolchains, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master 1e6d03ee 09/13: Print log messages before and after building, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master d3d0a775 13/13: Record speed measurements, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master cc85ea5a 11/13: Build libraries with specified toolchain, Greg Chicares, 2022/11/21
- [lmi-commits] [lmi] master a60c106c 07/13: Use clang's preprocessor,
Greg Chicares <=