In the ARM Linux development world, it's common to use gcc to pre-process "Device Tree" files to take advantage of #include and #define directives. Unfortunately, the DT syntax also includes the use of the '#', so they specify -x assembler-with-cpp, and it processes nicely. The typical invocation (with gcc) looks like this:
But of course it complains about the invalid preprocessing directive it finds (e.g. "#address-cells = <1>;"). The cure for this is "-x assembler-with-cpp", but if I invoke it like this:
cpp -x assembler-with-cpp FILE.dts
It says "clang: error: no input files". If I place the filename FILE.dts before any of the options, they don't get applied to that file.
The clang I'm trying this with is:
$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Rick Mann via cfe-dev <cfe-dev@lists.llvm.org> writes:
In the ARM Linux development world, it's common to use gcc to
pre-process "Device Tree" files to take advantage of #include and #define directives. Unfortunately, the DT syntax also includes the use
of the '#', so they specify -x assembler-with-cpp, and it processes
nicely. The typical invocation (with gcc) looks like this:
But of course it complains about the invalid preprocessing directive
it finds (e.g. "#address-cells = <1>;"). The cure for this is "-x
assembler-with-cpp", but if I invoke it like this:
cpp -x assembler-with-cpp FILE.dts
It says "clang: error: no input files". If I place the filename
FILE.dts before any of the options, they don't get applied to that
file.
The clang I'm trying this with is:
$ clang --version
Apple LLVM version 7.0.0 (clang-700.0.72)
Target: x86_64-apple-darwin14.5.0
Thread model: posix
Is there any way to do what I want to do here?
Does it work if you invoke `clang -E` instead of `cpp`? ie,