-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move stm32 compiler and linker basic info to a dedicated toolchain file
- Loading branch information
1 parent
702be67
commit cad5f4a
Showing
3 changed files
with
21 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
# Copyright (C) 2023-2024 Dmitry Ponomarev <[email protected]> | ||
# Distributed under the terms of the GPL v3 license, available in the file LICENSE. | ||
|
||
# Include the toolchain file | ||
include(${CMAKE_CURRENT_LIST_DIR}/cmake/Toolchain-arm-none-eabi.cmake) | ||
|
||
# Collect source files | ||
FILE(GLOB coreSources ${stm32cubeMxProjectPath}/Core/Src/*) | ||
FILE(GLOB driversSources ${stm32cubeMxProjectPath}/Drivers/*/*/*.c) | ||
FILE(GLOB startupFile ${stm32cubeMxProjectPath}/*.s | ||
|
16 changes: 16 additions & 0 deletions
16
Src/platform/stm32f103/cmake/Toolchain-arm-none-eabi.cmake
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright (C) 2023-2024 Dmitry Ponomarev <[email protected]> | ||
# Distributed under the terms of the GPL v3 license, available in the file LICENSE. | ||
|
||
# Define the system name and processor | ||
set(CMAKE_SYSTEM_NAME Generic) | ||
set(CMAKE_SYSTEM_PROCESSOR arm) | ||
|
||
# Define the compiler to be used | ||
set(TOOLCHAIN_PREFIX arm-none-eabi-) | ||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc) | ||
set(CMAKE_ASM_COMPILER ${CMAKE_C_COMPILER}) | ||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++) | ||
|
||
# Define the linker and other tools | ||
set(CMAKE_OBJCOPY ${TOOLCHAIN_PREFIX}objcopy) | ||
set(CMAKE_SIZE ${TOOLCHAIN_PREFIX}size) |