summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Angstenberger <code@jtxa.de>2020-08-31 23:52:45 (GMT)
committerJosef Angstenberger <code@jtxa.de>2020-09-20 22:57:20 (GMT)
commitfe9cddf181dbdc012127de04f5905d62c0d407bb (patch)
tree0883522989e1aee8fe46a15708b40d8c9ba2ce82
parent55fc045aa838ac2f2975df1208a3c7166c37305c (diff)
downloadCMake-fe9cddf181dbdc012127de04f5905d62c0d407bb.zip
CMake-fe9cddf181dbdc012127de04f5905d62c0d407bb.tar.gz
CMake-fe9cddf181dbdc012127de04f5905d62c0d407bb.tar.bz2
Compiler/TI: Add std options for C++98
The TI compiler does not support C++98, only C++03 (based on manual of current version). This change sets the C++98 option to C++03 based on the fact that it is done this way for the SunPro compiler already.
-rw-r--r--Help/manual/cmake-compile-features.7.rst2
-rw-r--r--Modules/Compiler/TI-CXX.cmake51
2 files changed, 52 insertions, 1 deletions
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 05dc038..690d293 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -358,6 +358,7 @@ versions specified for each:
* ``Cray``: Cray Compiler Environment version 8.1+.
* ``PGI``: PGI version 12.10+.
+* ``TI``: Texas Instruments compiler.
* ``XL``: IBM XL version 10.1+.
CMake is currently aware of the :prop_tgt:`C standards <C_STANDARD>` and
@@ -366,7 +367,6 @@ following :variable:`compiler ids <CMAKE_<LANG>_COMPILER_ID>` as of the
versions specified for each:
* all compilers and versions listed above with only meta-features for C++.
-* ``TI``: Texas Instruments compiler.
CMake is currently aware of the :prop_tgt:`CUDA standards <CUDA_STANDARD>` and
their associated meta-features (e.g. ``cuda_std_11``) available from the
diff --git a/Modules/Compiler/TI-CXX.cmake b/Modules/Compiler/TI-CXX.cmake
index c08d9a1..39e37f6 100644
--- a/Modules/Compiler/TI-CXX.cmake
+++ b/Modules/Compiler/TI-CXX.cmake
@@ -1,2 +1,53 @@
include(Compiler/TI)
__compiler_ti(CXX)
+
+# Architecture specific
+
+if("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "ARM")
+ set(__COMPILER_TI_CXX03_VERSION 5.2)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ set(__COMPILER_TI_CXX03_VERSION 4.4)
+
+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)
+
+else()
+ # architecture not handled
+ return()
+
+endif()
+
+
+if(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)
+
+elseif("${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}" STREQUAL "MSP430")
+ __compiler_check_default_language_standard(CXX 3.0 98)
+
+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)
+
+endif()