Skip to content

Commit

Permalink
CMakeLists.txt: parse zephyr_stdint.h after compiler specific flags
Browse files Browse the repository at this point in the history
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 3, 2019
1 parent e53c0d0 commit b86aa65
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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>
Expand Down

0 comments on commit b86aa65

Please sign in to comment.