我正在尝试使用 CMake 和 arm-none-eabi-gcc 在 MacBook M1 上构建一个 STM32 项目。这些是我的 CMake 代码:
cmake_minimum_required(VERSION 3.0.0)
project(Embedded VERSION 0.1.0)
set(CMAKE_C_COMPILER "arm-none-eabi-gcc")
add_compile_options(-g -mcpu=cortex-m4 -O2 -Wall -Werror -Wmissing-prototypes -mlittle-endian -fsingle-precision-constant -Wdouble-promotion)
add_executable(Embedded main.c)
set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
如果-arch,我怎样才能让CMake生成-march?