File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,47 @@ set(MICROCHIP_C_COMPILER_ID XC32)
7474set (CMAKE_C_STANDARD_COMPUTED_DEFAULT 90)
7575set (CMAKE_CXX_COMPILER_FORCED ON )
7676
77+
78+ set (link_flags "" )
79+ set (compile_flags "" )
80+
81+ list (APPEND compile_flags
82+ "-mprocessor=${MICROCHIP_MCU_MODEL} "
83+ )
84+ string (APPEND link_flags
85+ " -mprocessor=${MICROCHIP_MCU_MODEL} "
86+ )
87+ if (MICROCHIP_LINK_SCRIPT OR MICROCHIP_MIN_HEAP_SIZE)
88+ string (APPEND link_flags
89+ " -Wl"
90+ )
91+ if (MICROCHIP_LINK_SCRIPT)
92+ string (APPEND link_flags
93+ ",--script=\" ${MICROCHIP_LINK_SCRIPT} \" "
94+ )
95+ endif ()
96+ if (MICROCHIP_MIN_HEAP_SIZE)
97+ string (APPEND link_flags
98+ ",--defsym=_min_heap_size=${MICROCHIP_MIN_HEAP_SIZE} "
99+ )
100+ endif ()
101+ if (MICROCHIP_MAP_FILE)
102+ string (APPEND link_flags
103+ ",-Map=\" ${MICROCHIP_MAP_FILE} \" "
104+ )
105+ set_property (DIRECTORY APPEND
106+ PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
107+ "${MICROCHIP_MAP_FILE} "
108+ )
109+ endif ()
110+ endif ()
111+ string (APPEND CMAKE_C_LINK_FLAGS
112+ ${link_flags}
113+ )
114+ add_compile_options (
115+ ${compile_flags}
116+ )
117+
77118if (CMAKE_C_COMPILER)
78119 _xc32_get_version()
79120endif ()
You can’t perform that action at this time.
0 commit comments