zephyr/cmake/compiler/gcc/target_baremetal.cmake
Danny Oerndrup faa72b7015 cmake: Toolchain abstraction: Introducing toolchain_cc_freestanding
The macro is intended to abstract the -ffreestanding compiler option
which tells the compiler that this is a bare metal env. The option is
compiler and thus toolchain specific, but this macro leaves it up to
the toolchain to decide the value of the option.

The intent here is to abstract Zephyr's dependence on toolchains,
thus allowing for easier porting to other, perhaps commercial,
toolchains and/or usecases.

No functional change expected.

Signed-off-by: Danny Oerndrup <daor@demant.com>
2019-06-12 10:16:17 +02:00

21 lines
449 B
CMake

# SPDX-License-Identifier: Apache-2.0
# See root CMakeLists.txt for description and expectations of these macros
macro(toolchain_cc_nostdinc)
if (NOT CONFIG_NEWLIB_LIBC AND
NOT COMPILER STREQUAL "xcc" AND
NOT CONFIG_NATIVE_APPLICATION)
zephyr_compile_options( -nostdinc)
zephyr_system_include_directories(${NOSTDINC})
endif()
endmacro()
macro(toolchain_cc_freestanding)
zephyr_compile_options(-ffreestanding)
endmacro()