zephyr/cmake/compiler/gcc/target_imacros.cmake
Nicolas Pitre e53c0d0ec7 cmake: toolchain_cc_imacros: don't use the long argument form
Commit f57ba2d30c ("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>
2019-07-03 06:09:16 -04:00

16 lines
564 B
CMake

# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_cc_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()