Permalink
Browse files

Update Arduino CMake

Prior to this commit oscc used a no longer supported Arduino CMake based
toolchain. This commit fixes that by updating the toolchain to use the
arduino-cmake files.
  • Loading branch information...
rebpdx committed May 24, 2018
1 parent 887356f commit 8f0d547b451911a21e905c4741daca45ce761724
Showing with 3,988 additions and 2,263 deletions.
  1. +3 βˆ’0 .gitignore
  2. +56 βˆ’45 firmware/common/toolchain/ArduinoToolchain.cmake
  3. +61 βˆ’2,218 firmware/common/toolchain/Platform/Arduino.cmake
  4. +36 βˆ’0 firmware/common/toolchain/Platform/Core/BoardFlags/CompilerFlagsSetter.cmake
  5. +103 βˆ’0 firmware/common/toolchain/Platform/Core/BoardFlags/FlagsSetter.cmake
  6. +8 βˆ’0 firmware/common/toolchain/Platform/Core/BoardFlags/LinkerFlagsSetter.cmake
  7. +89 βˆ’0 firmware/common/toolchain/Platform/Core/BoardPropertiesReader.cmake
  8. +70 βˆ’0 firmware/common/toolchain/Platform/Core/Examples/ArduinoExampleFactory.cmake
  9. +35 βˆ’0 firmware/common/toolchain/Platform/Core/Examples/ArduinoLibraryExampleFactory.cmake
  10. +112 βˆ’0 firmware/common/toolchain/Platform/Core/Libraries/ArduinoLibraryFactory.cmake
  11. +34 βˆ’0 firmware/common/toolchain/Platform/Core/Libraries/BlacklistedLibrariesRemover.cmake
  12. +31 βˆ’0 firmware/common/toolchain/Platform/Core/Libraries/CoreLibraryFactory.cmake
  13. +128 βˆ’0 firmware/common/toolchain/Platform/Core/LibraryFinder.cmake
  14. +50 βˆ’0 firmware/common/toolchain/Platform/Core/Sketch/ArduinoSketchFactory.cmake
  15. +109 βˆ’0 firmware/common/toolchain/Platform/Core/Sketch/ArduinoSketchToCppConverter.cmake
  16. +36 βˆ’0 firmware/common/toolchain/Platform/Core/SourceFinder.cmake
  17. +47 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoBootloaderArgumentsBuilder.cmake
  18. +82 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoBootloaderBurnTargetCreator.cmake
  19. +48 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoBootloaderUploadTargetCreator.cmake
  20. +73 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoFirmwareTargetCreator.cmake
  21. +55 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoProgrammerArgumentsBuilder.cmake
  22. +41 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoProgrammerBurnTargetCreator.cmake
  23. +17 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoSerialTargetCreator.cmake
  24. +26 βˆ’0 firmware/common/toolchain/Platform/Core/Targets/ArduinoUploadTargetCreator.cmake
  25. +37 βˆ’0 firmware/common/toolchain/Platform/Core/VariableValidator.cmake
  26. +71 βˆ’0 firmware/common/toolchain/Platform/Extras/CalculateFirmwareSize.cmake
  27. +40 βˆ’0 firmware/common/toolchain/Platform/Extras/DebugOptions.cmake
  28. +32 βˆ’0 firmware/common/toolchain/Platform/Extras/GeneratorSettingsLoader.cmake
  29. +58 βˆ’0 firmware/common/toolchain/Platform/Extras/Macros.cmake
  30. +125 βˆ’0 firmware/common/toolchain/Platform/Extras/Printer.cmake
  31. +63 βˆ’0 firmware/common/toolchain/Platform/Generation/ArduinoExampleGenerator.cmake
  32. +80 βˆ’0 firmware/common/toolchain/Platform/Generation/ArduinoFirmwareGenerator.cmake
  33. +65 βˆ’0 firmware/common/toolchain/Platform/Generation/ArduinoLibraryExampleGenerator.cmake
  34. +52 βˆ’0 firmware/common/toolchain/Platform/Generation/ArduinoLibraryGenerator.cmake
  35. +53 βˆ’0 firmware/common/toolchain/Platform/Generation/AvrFirmwareGenerator.cmake
  36. +44 βˆ’0 firmware/common/toolchain/Platform/Generation/AvrLibraryGenerator.cmake
  37. +14 βˆ’0 firmware/common/toolchain/Platform/Initialization/DefineAdvancedVariables.cmake
  38. +67 βˆ’0 firmware/common/toolchain/Platform/Initialization/DetectVersion.cmake
  39. +58 βˆ’0 firmware/common/toolchain/Platform/Initialization/FindPrograms.cmake
  40. +24 βˆ’0 firmware/common/toolchain/Platform/Initialization/Initializer.cmake
  41. +134 βˆ’0 firmware/common/toolchain/Platform/Initialization/LoadArduinoPlatformSettings.cmake
  42. +18 βˆ’0 firmware/common/toolchain/Platform/Initialization/RegisterHardwarePlatform.cmake
  43. +96 βˆ’0 firmware/common/toolchain/Platform/Initialization/RegisterSpecificHardwarePlatform.cmake
  44. +6 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetDefaults.cmake
  45. +9 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetupArduinoSettings.cmake
  46. +96 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetupCompilerSettings.cmake
  47. +21 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetupExampleCategories.cmake
  48. +11 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetupFirmwareSizeScript.cmake
  49. +3 βˆ’0 firmware/common/toolchain/Platform/Initialization/SetupLibraryBlacklist.cmake
  50. +15 βˆ’0 firmware/common/toolchain/Platform/Initialization/TestSetup.cmake
  51. +1,346 βˆ’0 firmware/common/toolchain/README.rst
@@ -7,3 +7,6 @@
**/tests/**/Cargo.lock
**/tests/**/common/
**/tests/**/target/
#cucumber port
cucumber.wire
@@ -6,78 +6,89 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#=============================================================================#
if (_IS_TOOLCHAIN_PROCESSED)
return()
endif ()
set(_IS_TOOLCHAIN_PROCESSED True)
set(CMAKE_SYSTEM_NAME Arduino)
set(CMAKE_C_COMPILER avr-gcc)
set(CMAKE_C_COMPILER avr-gcc)
set(CMAKE_ASM_COMPILER avr-gcc)
set(CMAKE_CXX_COMPILER avr-g++)
# Add current directory to CMake Module path automatically
if(EXISTS ${CMAKE_CURRENT_LIST_DIR}/Platform/Arduino.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR})
endif()
if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/Platform/Arduino.cmake)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_LIST_DIR})
endif ()
#=============================================================================#
# System Paths #
#=============================================================================#
if(UNIX)
if (UNIX)
include(Platform/UnixPaths)
if(APPLE)
if (APPLE)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ~/Applications
/Applications
/Developer/Applications
/sw # Fink
/opt/local) # MacPorts
endif()
elseif(WIN32)
/Applications
/Developer/Applications
/sw # Fink
/opt/local) # MacPorts
endif ()
elseif (WIN32)
include(Platform/WindowsPaths)
endif()
endif ()
#=============================================================================#
# Detect Arduino SDK #
#=============================================================================#
if(NOT ARDUINO_SDK_PATH)
if ((NOT ARDUINO_SDK_PATH) AND (NOT DEFINED ENV{_ARDUINO_CMAKE_WORKAROUND_ARDUINO_SDK_PATH}))
set(ARDUINO_PATHS)
foreach(DETECT_VERSION_MAJOR 1)
foreach(DETECT_VERSION_MINOR RANGE 5 0)
foreach (DETECT_VERSION_MAJOR 1)
foreach (DETECT_VERSION_MINOR RANGE 5 0)
list(APPEND ARDUINO_PATHS arduino-${DETECT_VERSION_MAJOR}.${DETECT_VERSION_MINOR})
foreach(DETECT_VERSION_PATCH RANGE 3 0)
foreach (DETECT_VERSION_PATCH RANGE 3 0)
list(APPEND ARDUINO_PATHS arduino-${DETECT_VERSION_MAJOR}.${DETECT_VERSION_MINOR}.${DETECT_VERSION_PATCH})
endforeach()
endforeach()
endforeach()
endforeach ()
endforeach ()
endforeach ()
foreach(VERSION RANGE 23 19)
foreach (VERSION RANGE 23 19)
list(APPEND ARDUINO_PATHS arduino-00${VERSION})
endforeach()
endforeach ()
if(UNIX)
file(GLOB SDK_PATH_HINTS /usr/share/arduino*
/opt/local/arduino*
/opt/arduino*
/usr/local/share/arduino*)
elseif(WIN32)
set(SDK_PATH_HINTS "C:\\Program Files\\Arduino"
"C:\\Program Files (x86)\\Arduino"
)
endif()
if (UNIX)
file(GLOB SDK_PATH_HINTS
/usr/share/arduino*
/opt/local/arduino*
/opt/arduino*
/usr/local/share/arduino*)
elseif (WIN32)
set(SDK_PATH_HINTS
"C:\\Program Files\\Arduino"
"C:\\Program Files (x86)\\Arduino")
endif ()
list(SORT SDK_PATH_HINTS)
list(REVERSE SDK_PATH_HINTS)
endif()
find_path(ARDUINO_SDK_PATH
NAMES lib/version.txt
PATH_SUFFIXES share/arduino
Arduino.app/Contents/Resources/Java/
${ARDUINO_PATHS}
HINTS ${SDK_PATH_HINTS}
DOC "Arduino SDK path.")
if (DEFINED ENV{ARDUINO_SDK_PATH})
list(APPEND SDK_PATH_HINTS $ENV{ARDUINO_SDK_PATH})
endif ()
find_path(ARDUINO_SDK_PATH
NAMES lib/version.txt
PATH_SUFFIXES share/arduino Arduino.app/Contents/Resources/Java/ Arduino.app/Contents/Java/ ${ARDUINO_PATHS}
HINTS ${SDK_PATH_HINTS}
DOC "Arduino SDK base directory")
elseif ((NOT ARDUINO_SDK_PATH) AND (DEFINED ENV{_ARDUINO_CMAKE_WORKAROUND_ARDUINO_SDK_PATH}))
set(ARDUINO_SDK_PATH "$ENV{_ARDUINO_CMAKE_WORKAROUND_ARDUINO_SDK_PATH}")
endif ()
if (ARDUINO_SDK_PATH)
set(ENV{_ARDUINO_CMAKE_WORKAROUND_ARDUINO_SDK_PATH} "${ARDUINO_SDK_PATH}")
if(ARDUINO_SDK_PATH)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${ARDUINO_SDK_PATH}/hardware/tools/avr)
list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${ARDUINO_SDK_PATH}/hardware/tools/avr/utils)
else()
else ()
message(FATAL_ERROR "Could not find Arduino SDK (set ARDUINO_SDK_PATH)!")
endif()
endif ()
Oops, something went wrong.

0 comments on commit 8f0d547

Please sign in to comment.