mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-12 00:25:59 +00:00
The macro obtains the toolchain specific flag and value for setting of the requested c standard. 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>
21 lines
541 B
CMake
21 lines
541 B
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
# The intention with this file is, to have a common placeholder for macros
|
|
# which does not fit into any of the categories defined by the existing
|
|
# target_xxx.cmake files and which have a fairly high commonality between
|
|
# toolchains.
|
|
#
|
|
# See root CMakeLists.txt for description and expectations of this macro
|
|
|
|
macro(toolchain_cc_nocommon)
|
|
|
|
zephyr_compile_options(-fno-common)
|
|
|
|
endmacro()
|
|
|
|
macro(toolchain_cc_cstd_flag dest_var_name c_std)
|
|
|
|
set_ifndef(${dest_var_name} "-std=${c_std}")
|
|
|
|
endmacro()
|