Ver código fonte

Merge pull request #7 from 3d-gussner/build-with-cmake

Update bootstrap
vintagepc 2 anos atrás
pai
commit
d4a46a09c6
6 arquivos alterados com 35 adições e 27 exclusões
  1. 2 1
      .gitignore
  2. 2 2
      .vscode/cmake-kits.json
  3. 7 6
      CMakeLists.txt
  4. 2 2
      cmake/LocalAvrGcc.cmake
  5. 1 1
      cmake/Utilities.cmake
  6. 21 15
      utils/bootstrap.py

+ 2 - 1
.gitignore

@@ -3,8 +3,9 @@
 /.project
 /.cproject
 
+#cmake
 /build/
-
+.dependencies
 # Temporary configuration
 /Firmware/Configuration_prusa.h
 

+ 2 - 2
.vscode/cmake-kits.json

@@ -1,9 +1,9 @@
 [
     {
-        "name": "Local_gcc-avr-none-eabi",
+        "name": "Local_avr-gcc-none-eabi",
         "toolchainFile": "${workspaceFolder}/cmake/LocalAvrGcc.cmake",
         "cmakeSettings": {
-            "CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.9.0/ninja"
+            "CMAKE_MAKE_PROGRAM": "${workspaceFolder}/.dependencies/ninja-1.10.2/ninja"
         }
     }
 ]

+ 7 - 6
CMakeLists.txt

@@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.15)
 include(cmake/Utilities.cmake)
 
 set (CMAKE_CXX_STANDARD 11)
+set (PRUSA_BOARDS 1.0.5-2)
 project(Prusa-Firmware)
 
 get_recommended_gcc_version(RECOMMENDED_TOOLCHAIN_VERSION)
@@ -75,7 +76,7 @@ endif()
 #
 file(GLOB FW_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Firmware/*.c*)
 file(GLOB FW_HEADERS RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/Firmware/*.h*)
-file(GLOB AVR_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/cores/prusa_einsy_rambo/*.c*)
+file(GLOB AVR_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/*.c*)
 
   # Setup language resources:
 file(GLOB LANG_VARIANTS RELATIVE ${PROJECT_SOURCE_DIR}/lang/po ${PROJECT_SOURCE_DIR}/lang/po/Firmware_??.po)
@@ -85,8 +86,8 @@ message("Languages found: ${LANG_VARIANTS}")
 
 add_library(avr_core STATIC ${AVR_SOURCES})
 target_include_directories(avr_core PRIVATE
-  ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/cores/prusa_einsy_rambo/
-  ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/variants/prusa_einsy_rambo/
+  ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/
+  ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/variants/prusa_einsy_rambo/
 )
 target_compile_options(avr_core PUBLIC -mmcu=atmega2560)
 
@@ -98,7 +99,7 @@ function(fw_add_variant variant_name)
 
 
 #   # configure linker script
-   set(LINKER_SCRIPT ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/ldscripts/avr6.xn)
+   set(LINKER_SCRIPT ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/ldscripts/avr6.xn)
    target_link_options(${variant_name} PUBLIC -Wl,-T,${LINKER_SCRIPT})
 
   # limit the text section to 248K (256K - 8k reserved for the bootloader)
@@ -125,8 +126,8 @@ function(fw_add_variant variant_name)
 
 
   target_include_directories(${variant_name} PRIVATE Firmware
-    ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/cores/prusa_einsy_rambo/
-    ${PROJECT_SOURCE_DIR}/.dependencies/1.8.19-1.0.5-1-linux-64/portable/packages/PrusaResearch/hardware/avr/1.0.5-1/variants/prusa_einsy_rambo/
+    ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/cores/prusa_einsy_rambo/
+    ${PROJECT_SOURCE_DIR}/.dependencies/prusa3dboards-${PRUSA_BOARDS}/variants/prusa_einsy_rambo/
     ${PROJECT_SOURCE_DIR}/cmake/helpers/ # Add our magic config helper :)
     )
 

+ 2 - 2
cmake/LocalAvrGcc.cmake

@@ -3,8 +3,8 @@ include("${PROJECT_CMAKE_DIR}/Utilities.cmake")
 set(CMAKE_SYSTEM_NAME Generic)
 set(CMAKE_SYSTEM_PROCESSOR avr)
 set(CMAKE_CROSSCOMPILING 1)
-
-set(AVR_TOOLCHAIN_DIR "${PROJECT_CMAKE_DIR}/../.dependencies/1.8.19-1.0.5-1-linux-64/hardware/tools/avr/")
+set(AVR_GCC_VERSION 7.3.0)
+set(AVR_TOOLCHAIN_DIR "${PROJECT_CMAKE_DIR}/../.dependencies/avr-gcc-${AVR_GCC_VERSION}/")
 message( "tc dir is ${AVR_TOOLCHAIN_DIR}")
 #
 # Utilities

+ 1 - 1
cmake/Utilities.cmake

@@ -9,7 +9,7 @@ endif()
 function(get_recommended_gcc_version var)
   execute_process(
     COMMAND "${Python3_EXECUTABLE}" "${PROJECT_ROOT_DIR}/utils/bootstrap.py"
-            "--print-dependency-version" "gcc-avr"
+            "--print-dependency-version" "avr-gcc"
     OUTPUT_VARIABLE RECOMMENDED_VERSION
     OUTPUT_STRIP_TRAILING_WHITESPACE
     RESULT_VARIABLE RETVAL

+ 21 - 15
utils/bootstrap.py

@@ -29,29 +29,35 @@ dependencies_dir = project_root_dir / '.dependencies'
 # yapf: disable
 dependencies = {
     'ninja': {
-        'version': '1.9.0',
+        'version': '1.10.2',
         'url': {
-            'Linux': 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-linux.zip',
-            'Windows': 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip',
-            'Darwin': 'https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-mac.zip',
+            'Linux': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip',
+            'Windows': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-win.zip',
+            'Darwin': 'https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-mac.zip',
         },
     },
     'cmake': {
-        'version': '3.15.5',
+        'version': '3.22.5',
         'url': {
-            'Linux': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Linux-x86_64.tar.gz',
-            'Windows': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-win64-x64.zip',
-            'Darwin': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Darwin-x86_64.tar.gz',
+            'Linux': 'https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-Linux-x86_64.tar.gz',
+            'Windows': 'https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-win64-x64.zip',
+            'Darwin': 'https://github.com/Kitware/CMake/releases/download/v3.22.5/cmake-3.22.5-Darwin-x86_64.tar.gz',
         },
     },
-    'gcc-avr': {
-        # dummy placeholder (currently downloading cmake just for the sake of a valid url/zip archive)
-        # ... we truly need the binaries! :)
-        'version': '0.0.0',
+    'avr-gcc': {
+        'version': '7.3.0',
         'url': {
-            'Linux': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Linux-x86_64.tar.gz',
-            'Windows': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-win64-x64.zip',
-            'Darwin': 'https://github.com/Kitware/CMake/releases/download/v3.15.5/cmake-3.15.5-Darwin-x86_64.tar.gz',
+            'Linux': 'http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino7-x86_64-pc-linux-gnu.tar.bz2',
+            'Windows': 'http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino7-i686-w64-mingw32.zip',
+            'Darwin': 'http://downloads.arduino.cc/tools/avr-gcc-7.3.0-atmel3.6.1-arduino7-x86_64-apple-darwin14.tar.bz2',
+        },
+    },
+    'prusa3dboards': {
+        'version': '1.0.5-2',
+        'url': {
+            'Linux': 'https://raw.githubusercontent.com/prusa3d/Arduino_Boards/devel/IDE_Board_Manager/prusa3dboards-1.0.5-2.tar.bz2',
+            'Windows': 'https://raw.githubusercontent.com/prusa3d/Arduino_Boards/devel/IDE_Board_Manager/prusa3dboards-1.0.5-2.tar.bz2',
+            'Darwin': 'https://raw.githubusercontent.com/prusa3d/Arduino_Boards/devel/IDE_Board_Manager/prusa3dboards-1.0.5-2.tar.bz2',
         }
     },
 }