having setup an AVR project in Clion on m1 mac I encountered some problem compiling the project I appreciate any help in advance
CMakeLists.txt
project(micro_controller C)
SET(MCU "atmega328")
SET(F_CPU "16000000")
SET(CMAKE_SYSTEM_NAME Generic)
SET(CMAKE_C_COMPILER /opt/homebrew/Cellar/avr-gcc@11/11.3.0_1/bin/avr-gcc)
SET(CMAKE_C_FLAGS "-mmcu=${MCU} -DF_CPU=${F_CPU} -Os")
SET(CMAKE_C_LINK_FLAGS "-mmcu=${MCU} -m32 -O2")
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
add_executable(micro_controller main.c)
main.c
#include <stdio.h>
#include <avr/io.h>
#include "avr/delay.h"
int main() {
return 0;
}
Debug
/Applications/CLion.app/Contents/bin/cmake/mac/bin/cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_MAKE_PROGRAM=/Applications/CLion.app/Contents/bin/ninja/mac/ninja -G Ninja -S /Users/clonerplus/micro_controller -B /Users/clonerplus/micro_controller/cmake-build-debug
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/clonerplus/micro_controller/cmake-build-debug
Problems were encountered while collecting compiler information:
avr-gcc: error: unrecognized command-line option '-arch'
[Finished]