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

add cmake compilation scripts for quickjs #56

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

HoTBAIzZY
Copy link

@HoTBAIzZY HoTBAIzZY commented Jan 14, 2025

Summary

add cmake compilation scripts for quickjs
Related:open-vela/nuttx#142

Impact

nop

Testing

$ git clone https://github.com/apache/nuttx
$ git clone https://github.com/apache/apps
$ cd nuttx
$ cmake -B build -DBOARD_CONFIG=sim:quickjs
$ cmake --build build
$ ./build/nuttx
NuttShell (NSH)
nsh> qjs
QuickJS - Type "\h" for help
qjs > console.log("Hello World")
Hello World

@CLAassistant
Copy link

CLAassistant commented Jan 14, 2025

CLA assistant check
All committers have signed the CLA.

new file mode 100644
index 0000000..0dc6fd5
--- /dev/null
+++ b/CMakeLists.txt
Copy link
Collaborator

Choose a reason for hiding this comment

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

why need patch quickjs self?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is for building the qjsc tool of target x86_64. If CONFIG_INTERPRETERS_QUICKJS_FULL is enabled, the qjsc tool is needed to compile js to bytecode

Copy link
Collaborator

Choose a reason for hiding this comment

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

but we don't use CMakeList.txt from qjs?

Copy link
Contributor

Choose a reason for hiding this comment

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

This CMakeList.txt will be saved in directory interpreters/quickjs/quickjs, and will be used to execute cross-compilation of qjsc at

ExternalProject_Add(
qjsc
SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/quickjs
BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/
CMAKE_ARGS -DCONFIG_BIGNUM=${CONFIG_INTERPRETERS_QUICKJS_BIGNUM}
-DQUICKJS_VERSION=${QUICKJS_VERSION} -DAPPDIR=${NUTTX_APPS_DIR}
TEST_COMMAND ""
INSTALL_COMMAND "")

Copy link
Collaborator

@GUIDINGLI GUIDINGLI left a comment

Choose a reason for hiding this comment

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

LGTM

@xiaoxiang781216 xiaoxiang781216 merged commit 003044a into open-vela:dev Jan 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants