zephyr/cmake/compiler
Nicolas Pitre f57ba2d30c cmake: toolchain_cc_imacros: don't use space separated arguments
Because CMake explicitly deduplicates arguments, it is not possible
to use toolchain_cc_imacros() multiple times as the later "-imacros"
are stripped away, leaving the associated file arguments dangling.
The documented workaround in the CMake manual involves some "SHELL:..."
construct but that doesn't get through zephyr_compile_options()
undammaged.

Let's simply remove this issue altogether by replacing "-imacros x.h"
with the joined form "--imacros=x.h" instead. Both gcc and clang
support this syntax.

FYI, this joined form is also available for other arguments such as:

	-include x.h   -->   --include=x.h
	-A foo         -->   --assert=foo
	-D foo         -->   --define-macro=foo
	-U foo         -->   --undefine-macro=foo

Etc.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
2019-06-25 23:29:22 -04:00
..
clang cmake: Toolchain abstraction: Introducing macro toolchain_cc_nocommon 2019-06-13 13:08:11 +02:00
gcc cmake: toolchain_cc_imacros: don't use space separated arguments 2019-06-25 23:29:22 -04:00
host-gcc cmake: Toolchain abstraction: Introducing macro toolchain_cc_nocommon 2019-06-13 13:08:11 +02:00
xcc cmake: Toolchain abstraction: Introducing macro toolchain_cc_nocommon 2019-06-13 13:08:11 +02:00