blob: 68a364c3126573c45a5cf64610185570225cc464 [file] [log] [blame]
Christophe Favergeon6b604eb2019-05-17 13:46:33 +02001include(CMakePrintHelpers)
2include(configUtils)
3
4enable_language(C ASM)
5
6option(FILEIO "Test trace using printf" ON)
7
8# Otherwise there is a .obj on windows and it creates problems
9# with armlink.
10SET(CMAKE_C_OUTPUT_EXTENSION .o)
11SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
12SET(CMAKE_ASM_OUTPUT_EXTENSION .o)
13
14
15get_filename_component(PROJECT_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME)
16
17cmake_print_variables(PROJECT_NAME)
18
Christophe Favergeon04ed2f02019-05-29 09:54:37 +020019#set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..)
Christophe Favergeon6b604eb2019-05-17 13:46:33 +020020
21if (ARMAC6)
22
23 ###################
24 #
25 # Cortex cortex-m7
26 #
27 if (ARM_CPU STREQUAL "cortex-m7")
28 cortexm(ARMCM7)
29
30 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMCM7_DP)
31
32
33 endif()
34
35 ###################
36 #
37 # Cortex cortex-m4
38 #
39 if (ARM_CPU STREQUAL "cortex-m4")
40 cortexm(ARMCM4)
41 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMCM4_FP)
42 endif()
43
44 ###################
45 #
46 # Cortex cortex-m35p
47 #
48 if (ARM_CPU STREQUAL "cortex-m35")
49 cortexm(ARMCM35P)
50 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMCM35P)
51 endif()
52
53 ###################
54 #
55 # Cortex cortex-m33
56 #
57 if (ARM_CPU STREQUAL "cortex-m33")
58 cortexm(ARMCM33)
59 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMCM33)
60 endif()
61
62 ###################
63 #
64 # Cortex cortex-m23
65 #
66 if (ARM_CPU STREQUAL "cortex-m23")
67 cortexm(ARMCM23)
68 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMCM23)
69 endif()
70
71 ###################
72 #
73 # Cortex cortex-m0+
74 #
75 if (ARM_CPU STREQUAL "cortex-m0p")
76 cortexm(ARMCM0plus)
77 endif()
78
79 ###################
80 #
81 # Cortex cortex-m0
82 #
83 if (ARM_CPU STREQUAL "cortex-m0")
84 cortexm(ARMCM0)
85 endif()
86
87 ###################
88 #
89 # Cortex cortex-a5
90 #
91 if (ARM_CPU STREQUAL "cortex-a5")
92 cortexa(ARMCA5)
Christophe Favergeon04ed2f02019-05-29 09:54:37 +020093 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMv7A)
Christophe Favergeon6b604eb2019-05-17 13:46:33 +020094 endif()
95
96 ###################
97 #
98 # Cortex cortex-a7
99 #
100 if (ARM_CPU STREQUAL "cortex-a7")
101 cortexa(ARMCA7)
Christophe Favergeon04ed2f02019-05-29 09:54:37 +0200102 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMv7A)
Christophe Favergeon6b604eb2019-05-17 13:46:33 +0200103 endif()
104
105 ###################
106 #
107 # Cortex cortex-a9
108 #
109 if (ARM_CPU STREQUAL "cortex-a9")
110 cortexa(ARMCA9)
Christophe Favergeon04ed2f02019-05-29 09:54:37 +0200111 target_compile_definitions(${PROJECT_NAME} PRIVATE ARMv7A)
Christophe Favergeon6b604eb2019-05-17 13:46:33 +0200112 endif()
113
114endif()
115
116if (FILEIO)
117 target_compile_definitions(${PROJECT_NAME} PRIVATE FILEIO)
118endif()