summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/TI-CXX.cmake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-09-22 11:48:17 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-09-22 11:48:24 (GMT)
commit2c896c381ba1031b888b6896b89cf13ae5948889 (patch)
treea31be4bf212a261dd35f93850f0bcd6c1b5a4967 /Modules/Compiler/TI-CXX.cmake
parent966c3263c2febfb3ff6c46312606f309ee1ab833 (diff)
parent6a66bb13ed80398d908bc07a89589dae74069ef2 (diff)
downloadCMake-2c896c381ba1031b888b6896b89cf13ae5948889.zip
CMake-2c896c381ba1031b888b6896b89cf13ae5948889.tar.gz
CMake-2c896c381ba1031b888b6896b89cf13ae5948889.tar.bz2
Merge topic 'comp-ti-std-options'
6a66bb13ed Compiler/TI: Add std options for C++14 fe9cddf181 Compiler/TI: Add std options for C++98 55fc045aa8 Compiler/TI: Add std options for C11 2e69993101 Compiler/TI: Check default C standard 8300030f71 Compiler/TI: Check compiler version for C99 support 0b4582f229 Compiler/TI: Fix definition of std options a70df0d6f0 Compiler/TI: Avoid generic variable name in macro Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5249
Diffstat (limited to 'Modules/Compiler/TI-CXX.cmake')
-rw-r--r--Modules/Compiler/TI-CXX.cmake69
1 files changed, 69 insertions, 0 deletions
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index c08d9a1..4b6efcd 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -1,2 +1,71 @@
include(Compiler/TI)
__compiler_ti(CXX)
+
+# Architecture specific
+
+if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ set(__COMPILER_TI_CXX03_VERSION 5.2)
+ set(__COMPILER_TI_CXX14_VERSION 18.1)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ set(__COMPILER_TI_CXX03_VERSION 4.4)
+ set(__COMPILER_TI_CXX14_VERSION 18.1)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
+ set(__COMPILER_TI_CXX03_VERSION 16.9)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
+ set(__COMPILER_TI_CXX03_VERSION 8.1)
+ set(__COMPILER_TI_CXX14_VERSION 8.3)
+
+else()
+ # architecture not handled
+ return()
+
+endif()
+
+
+if(DEFINED __COMPILER_TI_CXX14_VERSION AND
+ CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_CXX14_VERSION}")
+
+ # C++03 is not supported anymore
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--strict_ansi")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--relaxed_ansi")
+
+ # C++11 was never supported
+ set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "--strict_ansi")
+ set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "--relaxed_ansi")
+
+ set(CMAKE_CXX14_STANDARD_COMPILE_OPTION "--c++14" "--strict_ansi")
+ set(CMAKE_CXX14_EXTENSION_COMPILE_OPTION "--c++14" "--relaxed_ansi")
+
+
+elseif(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "${__COMPILER_TI_CXX03_VERSION}")
+
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--c++03" "--strict_ansi")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--c++03" "--relaxed_ansi")
+
+else()
+
+ set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "--strict_ansi")
+ set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "--relaxed_ansi")
+
+endif()
+
+
+# Architecture specific
+# CXX98 versions: https://processors.wiki.ti.com/index.php/C%2B%2B_Support_in_TI_Compilers
+
+if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ __compiler_check_default_language_standard(CXX 4.5 98 ${__COMPILER_TI_CXX14_VERSION} 14)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ __compiler_check_default_language_standard(CXX 3.0 98 ${__COMPILER_TI_CXX14_VERSION} 14)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C28x")
+ __compiler_check_default_language_standard(CXX 5.1 98)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "TMS320C6x")
+ __compiler_check_default_language_standard(CXX 6.1 98 ${__COMPILER_TI_CXX14_VERSION} 14)
+
+endif()