Skip to content
Permalink
Browse files

cmake: toolchain_cc_imacros: don't use the long argument form

Commit f57ba2d ("cmake: toolchain_cc_imacros: don't use space
separated arguments") moved toolchain_cc_imacros() to using the long
argument format in order to avoid spaces that CMake uses to delimitate
and deduplicate arguments.

It seems that xcc doesn't support the --imacros=foo form. However
it does support the short "combined" -imacrosfoo form (without space).
So let's use that instead and document the caviat.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and nashif committed Jul 2, 2019
1 parent 530a1e5 commit e53c0d0ec7640bd24efb16286a2cbc9a72ebcbf6
Showing with 7 additions and 1 deletion.
  1. +7 −1 cmake/compiler/gcc/target_imacros.cmake
@@ -4,6 +4,12 @@

macro(toolchain_cc_imacros header_file)

zephyr_compile_options(--imacros=${header_file})
# We cannot use the "-imacros foo" form here as CMake insists on
# deduplicating arguments, meaning that subsequent usages after the
# first one will see the "-imacros " part removed.
# gcc and clang support the "--imacros=foo" form but not xcc.
# Let's use the "combined" form (without space) which is supported
# by everyone so far.
zephyr_compile_options(-imacros${header_file})

endmacro()

0 comments on commit e53c0d0

Please sign in to comment.
You can’t perform that action at this time.