-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
70 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
build/ | ||
sdkconfig | ||
sdkconfig.old | ||
.vscode | ||
components/picoruby-esp32/mrb | ||
mrb | ||
.env | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
[submodule "components/picoruby-esp32/picoruby"] | ||
path = components/picoruby-esp32/picoruby | ||
[submodule "picoruby"] | ||
path = picoruby | ||
url = https://github.com/picoruby/picoruby.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,68 @@ | ||
# The following lines of boilerplate have to be in your project's | ||
# CMakeLists in this exact order for cmake to work correctly | ||
cmake_minimum_required(VERSION 3.16) | ||
idf_component_register( | ||
SRCS | ||
${COMPONENT_DIR}/picoruby-esp32.c | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-machine/ports/esp32/machine.c | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-io-console/ports/esp32/io-console.c | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-filesystem-fat/ports/esp32/flash_disk.c | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-env/ports/esp32/env.c | ||
INCLUDE_DIRS | ||
${COMPONENT_DIR} | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-mrubyc/lib/mrubyc/src | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-machine/include | ||
${COMPONENT_DIR}/picoruby/mrbgems/picoruby-filesystem-fat/ports/esp32 | ||
REQUIRES esp_driver_uart | ||
) | ||
|
||
include($ENV{IDF_PATH}/tools/cmake/project.cmake) | ||
project(picoruby-esp32) | ||
add_definitions( | ||
-DMRBC_TICK_UNIT=10 | ||
-DMRBC_TIMESLICE_TICK_COUNT=1 | ||
-DMRBC_USE_FLOAT=2 | ||
-DMRC_CUSTOM_ALLOC | ||
-DMRBC_CONVERT_CRLF=1 | ||
-DNDEBUG | ||
) | ||
|
||
set(PICORUBY_DIR ${COMPONENT_DIR}/picoruby) | ||
set(LIBMRUBY_FILE ${PICORUBY_DIR}/build/esp32/lib/libmruby.a) | ||
|
||
# Build PicoRuby | ||
add_custom_command( | ||
OUTPUT ${LIBMRUBY_FILE} | ||
COMMAND ${CMAKE_COMMAND} -E echo "MRUBY_CONFIG=${IDF_TARGET_ARCH}-esp rake" | ||
COMMAND ${CMAKE_COMMAND} -E env MRUBY_CONFIG=${IDF_TARGET_ARCH}-esp rake | ||
WORKING_DIRECTORY ${PICORUBY_DIR} | ||
COMMENT "PicoRuby build" | ||
VERBATIM | ||
) | ||
|
||
add_prebuilt_library( | ||
libmruby ${LIBMRUBY_FILE} | ||
REQUIRES ${COMPONENT_NAME} | ||
) | ||
target_link_libraries(${COMPONENT_LIB} PRIVATE libmruby) | ||
|
||
add_custom_target( | ||
picoruby DEPENDS ${LIBMRUBY_FILE} | ||
DEPENDS ${LIBMRUBY_FILE} | ||
) | ||
add_dependencies(${COMPONENT_LIB} picoruby) | ||
|
||
# Compile Ruby files | ||
add_custom_target( | ||
mrbdir ALL | ||
COMMAND ${CMAKE_COMMAND} -E make_directory ${COMPONENT_DIR}/mrb | ||
) | ||
add_dependencies(${COMPONENT_LIB} mrbdir) | ||
|
||
set(RUBY_FILES main_task) | ||
set(PICORBC ${COMPONENT_DIR}/picoruby/bin/picorbc) | ||
|
||
foreach(rb ${RUBY_FILES}) | ||
add_custom_target(${rb} | ||
COMMAND ${PICORBC} -B${rb} -o${COMPONENT_DIR}/mrb/${rb}.c ${COMPONENT_DIR}/mrblib/${rb}.rb | ||
DEPENDS mrbdir | ||
) | ||
endforeach(rb) | ||
|
||
add_custom_target(generate_files ALL DEPENDS mrbdir ${RUBY_FILES}) | ||
add_dependencies(${COMPONENT_LIB} generate_files) |
File renamed without changes.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Submodule picoruby
updated
from 000000 to b1977b
File renamed without changes.
File renamed without changes.
Empty file.