From 55fc045aa838ac2f2975df1208a3c7166c37305c Mon Sep 17 00:00:00 2001 From: Josef Angstenberger Date: Tue, 1 Sep 2020 01:45:09 +0200 Subject: Compiler/TI: Add std options for C11 --- Modules/Compiler/TI-C.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Modules/Compiler/TI-C.cmake b/Modules/Compiler/TI-C.cmake index 3941577..3c97afb 100644 --- a/Modules/Compiler/TI-C.cmake +++ b/Modules/Compiler/TI-C.cmake @@ -6,12 +6,15 @@ __compiler_ti(C) if("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM") set(__COMPILER_TI_C99_VERSION_ARM 5.2) + set(__COMPILER_TI_C11_VERSION_ARM 18.12) elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430") set(__COMPILER_TI_C99_VERSION_MSP430 4.3) + set(__COMPILER_TI_C11_VERSION_MSP430 18.12) elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x") set(__COMPILER_TI_C99_VERSION_TMS320C28x 6.3) + set(__COMPILER_TI_C11_VERSION_TMS320C28x 18.9) elseif("${CMAKE_C_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x") set(__COMPILER_TI_C99_VERSION_TMS320C6x 7.5) @@ -31,6 +34,14 @@ if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C99_VERSION_$ set(CMAKE_C99_STANDARD_COMPILE_OPTION "--c99" "--strict_ansi") set(CMAKE_C99_EXTENSION_COMPILE_OPTION "--c99" "--relaxed_ansi") + if(DEFINED __COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID} AND + CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_C11_VERSION_${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}}") + + set(CMAKE_C11_STANDARD_COMPILE_OPTION "--c11" "--strict_ansi") + set(CMAKE_C11_EXTENSION_COMPILE_OPTION "--c11" "--relaxed_ansi") + + endif() + else() set(CMAKE_C90_STANDARD_COMPILE_OPTION "--strict_ansi") -- cgit v0.12