Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions c/cmake/Toolchain-gcc-arm-embedded.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,26 @@ message(STATUS "Cross-compiling with the gcc-arm-embedded toolchain")
message(STATUS "Toolchain prefix: ${CMAKE_INSTALL_PREFIX}")

set(CMAKE_FIND_ROOT_PATH ${CMAKE_INSTALL_PREFIX})

set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

set(CMAKE_C_FLAGS "-fno-common -ffunction-sections -fdata-sections")

if (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m4")

set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS}"
"-mcpu=cortex-m4 -march=armv7e-m -mthumb"
"-mfloat-abi=hard -mfpu=fpv4-sp-d16"
)

elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m7")

set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS}"
"-mcpu=cortex-m7 -mthumb"
"-mfpu=fpv5-d16 -mfloat-abi=hard"
)

elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "cortex-m3")

set(CMAKE_C_FLAGS
Expand Down Expand Up @@ -92,5 +97,6 @@ string(REGEX REPLACE ";" " " CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" CACHE STRING "")

set(BUILD_SHARED_LIBS OFF)
set(BUILD_SHARED_LIBS OFF)