Skip to content
Permalink
Browse files

CMakeLists.txt: parse zephyr_stdint.h after compiler specific flags

The zephyr_stdint.h file enforces Zephyr specific policies on the
compilation environment. Let's give compilers a chance to provide
definitions of their own via TOOLCHAIN_C_FLAGS prior the inclusion
of zephyr_stdint.h.

Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
  • Loading branch information...
Nicolas Pitre authored and nashif committed Jul 2, 2019
1 parent e53c0d0 commit b86aa65723134a26643d03266147d039b4821bbe
Showing with 4 additions and 3 deletions.
  1. +4 −3 CMakeLists.txt
@@ -220,9 +220,6 @@ toolchain_cc_nostdinc()
# @Intent: Set compiler specific macro inclusion of AUTOCONF_H
toolchain_cc_imacros(${AUTOCONF_H})

# @Intent: Enforce standard integer type correspondance to match Zephyr usage.
toolchain_cc_imacros(${ZEPHYR_BASE}/include/toolchain/zephyr_stdint.h)

# @Intent: Set compiler specific flag for bare metal freestanding option
toolchain_cc_freestanding()

@@ -240,6 +237,10 @@ zephyr_compile_options(
$<$<COMPILE_LANGUAGE:ASM>:${ASM_BASE_FLAG}>
)

# @Intent: Enforce standard integer type correspondance to match Zephyr usage.
# (must be after compiler specific flags)
toolchain_cc_imacros(${ZEPHYR_BASE}/include/toolchain/zephyr_stdint.h)

# Common toolchain-agnostic assembly flags
zephyr_compile_options(
$<$<COMPILE_LANGUAGE:ASM>:-D_ASMLANGUAGE>

0 comments on commit b86aa65

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