summaryrefslogtreecommitdiffstats
path: root/Modules/Compiler/TI-CXX.cmake
blob: 39e37f697b10168fff93cdf70f3f429449cd5c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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()