blob: 52e7717cd7d4e741f05e88f239a0c7765d7d6b3d [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
19set(ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../../../..)
20
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)
93 endif()
94
95 ###################
96 #
97 # Cortex cortex-a7
98 #
99 if (ARM_CPU STREQUAL "cortex-a7")
100 cortexa(ARMCA7)
101 endif()
102
103 ###################
104 #
105 # Cortex cortex-a9
106 #
107 if (ARM_CPU STREQUAL "cortex-a9")
108 cortexa(ARMCA9)
109 endif()
110
111endif()
112
113if (FILEIO)
114 target_compile_definitions(${PROJECT_NAME} PRIVATE FILEIO)
115endif()