Commit c2882410 authored by Alberto Escolar Piedras's avatar Alberto Escolar Piedras Committed by Anas Nashif
Browse files

cmake: Allow C standard version to be overriden



Allow archs/boards/apps to override the C standard version.

Signed-off-by: default avatarAlberto Escolar Piedras <alpi@oticon.com>
parent 0de49e5d
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -120,8 +120,6 @@ zephyr_compile_options(
)

zephyr_compile_options(
  $<$<COMPILE_LANGUAGE:C>:-std=c99>

  $<$<COMPILE_LANGUAGE:CXX>:-std=c++11>
  $<$<COMPILE_LANGUAGE:CXX>:-fcheck-new>
  $<$<COMPILE_LANGUAGE:CXX>:-ffunction-sections>
@@ -992,6 +990,13 @@ get_property(GKSF GLOBAL PROPERTY GENERATED_KERNEL_SOURCE_FILES)
get_property(TOPT GLOBAL PROPERTY TOPT)
set_ifndef(  TOPT -T)

get_property(CSTD GLOBAL PROPERTY CSTD)
set_ifndef(CSTD c99)

zephyr_compile_options(
  $<$<COMPILE_LANGUAGE:C>:-std=${CSTD}>
)

configure_file(
     $ENV{ZEPHYR_BASE}/include/arch/arm/cortex_m/scripts/app_data_alignment.ld
     ${PROJECT_BINARY_DIR}/include/generated/app_data_alignment.ld)