Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MOD: Added support for avr-gcc from homebrew #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion example-c++/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# Matthias Kleemann
##########################################################################

cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.22)

### TOOLCHAIN SETUP AREA #################################################
# Set any variables used in the toolchain prior project() call. In that
Expand Down
15 changes: 13 additions & 2 deletions example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
# Matthias Kleemann
##########################################################################

cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.22)

### TOOLCHAIN SETUP AREA #################################################
# Set any variables used in the toolchain prior project() call. In that
# case they are already set and used.
##########################################################################

# set export compile commands on for YouCompleteMe Support
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
##########################################################################
# tools to beused for programming the AVR
##########################################################################
Expand Down Expand Up @@ -64,7 +66,7 @@ endif(NOT CMAKE_BUILD_TYPE)
##########################################################################
# needs to be defined for AVR toolchain
##########################################################################
set(MCU_SPEED "4000000UL")
set(MCU_SPEED "16000000UL")

##########################################################################
# some cmake cross-compile necessities
Expand All @@ -80,6 +82,8 @@ else(DEFINED ENV{AVR_FIND_ROOT_PATH})
set(CMAKE_FIND_ROOT_PATH "/usr/lib/avr")
elseif(EXISTS "/usr/local/CrossPack-AVR")
set(CMAKE_FIND_ROOT_PATH "/usr/local/CrossPack-AVR")
elseif(EXISTS "/usr/local/Cellar/avr-gcc@9")
set(CMAKE_FIND_ROOT_PATH "/usr/local/Cellar/avr-gcc@9/9.3.0_3/avr")
else(EXISTS "/opt/local/avr")
message(FATAL_ERROR "Please set AVR_FIND_ROOT_PATH in your environment.")
endif(EXISTS "/opt/local/avr")
Expand Down Expand Up @@ -156,3 +160,10 @@ set(DOXYGEN_CONF_IN "doxygen.conf")
include("${PROJECT_SOURCE_DIR}/../Modules/defaultDocuTarget.cmake")


IF( EXISTS "${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json" )
EXECUTE_PROCESS( COMMAND ${CMAKE_COMMAND} -E copy_if_different
${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you want to copy that into the source directory? Normally generated files should stay in the build folder in order to not pollute the source directory. Instead, you could configure your plugin to read the compile_commands.json from the build folder.

)
ENDIF()