1. 14 6月, 2023 14 次提交
  2. 13 6月, 2023 2 次提交
    • B
      rp2/CMake: Normalize MICROPY_PORT_DIR. · ea8f0fd8
      Brian 'redbeard' Harrington 提交于
      In 5fe2a3f1 the ESP32 port underwent a change to how `MICROPY_PORT_DIR`
      is defined.  This commit normalizes the `rp2` port to use the same
      underlying variable mechanism (`CMAKE_CURRENT_LIST_DIR`).
      Signed-off-by: NBrian 'redbeard' Harrington <redbeard@dead-city.org>
      ea8f0fd8
    • B
      esp32/CMake: Change PROJECT_DIR to CMAKE_CURRENT_LIST_DIR. · 5fe2a3f1
      Brian 'redbeard' Harrington 提交于
      This migrates the CMake variable `MICROPY_PORT_DIR` from the ESP-IDF
      defined project to the component. Previously used instances of the variable
      within the project definition have been migrated to
      `CMAKE_CURRENT_LIST_DIR`. Within the component (the `main` subdirectory in
      the ESP32 port) we define `MICROPY_PORT_DIR` using `CMAKE_CURRENT_LIST_DIR`
      and subsequently use the `MICROPY_PORT_DIR` value in all locations where
      `PROJECT` had previously been used.
      
      Context:
      
      In commit 9b908821, initial support was added for building with the newly
      introduced CMake support provided by the ESP-IDF.
      
      Specifically, the commit message states:
      
      > This commit adds support for building the esp32 port with CMake, and in
      particular, it builds MicroPython as a component within the ESP-IDF. Using
      CMake and the ESP-IDF build infrastructure makes it much easier to maintain
      the port, especially with the various new ESP32 MCUs and their required
      toolchains.
      
      `PROJECT_DIR` is a variable populated by the ESP-IDF specifically and is
      not stable when used with "[Pure CMake components][1]" as documented in the
      ESP-IDF. It is intended to be used in the scope of the parent of the
      current file (the "project") as opposed to the current file ("the
      component"). Crossing into the parent scope like this works solely when the
      "project" is MicroPython, but not when used as a component by other ESP-IDF
      projects.
      
      Analyzing this file, the intention is to reference the "Project" which in
      the example is the parent directory. Within the [CMake variables][2]
      documentation, there is one specifically defined for referencing the
      directory for the CMake listfile currently being processed:
      [`CMAKE_CURRENT_LIST_DIR`][3].
      
      After making the change from `PROJECT_DIR` to `CMAKE_CURRENT_LIST_DIR`, the
      reach into the parent scope defined by the ESP-IDF and the resulting CMake
      interface violation is removed.
      
      Similar to the component definition, the project `CMakeLists.txt` uses the
      variable `CMAKE_SOURCE_DIR` which CMake defines as "The path to the top
      level of the source tree."  This commit changes the variable to
      `CMAKE_CURRENT_LIST_DIR` for the reasons cited above.
      
      [1]: https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/api-guides/build-system.html#writing-pure-cmake-components
      [2]: https://cmake.org/cmake/help/latest/manual/cmake-variables.7.html
      [3]: https://cmake.org/cmake/help/latest/variable/CMAKE_CURRENT_LIST_DIR.htmlSigned-off-by: NBrian 'redbeard' Harrington <redbeard@dead-city.org>
      5fe2a3f1
  3. 10 6月, 2023 1 次提交
  4. 09 6月, 2023 1 次提交
  5. 08 6月, 2023 22 次提交