-
Notifications
You must be signed in to change notification settings - Fork 172
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
Allow embedding txiki in other applications #517
Conversation
a867314
to
46793d7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, let's do this! Left some comments.
CMakeLists.txt
Outdated
target_link_libraries(tjs qjs uv_a m3 sqlite3 m pthread ${CURL_LIBRARIES}) | ||
|
||
if (BUILD_WITH_MIMALLOC) | ||
target_compile_definitions(tjs PRIVATE TJS__HAS_MIMALLOC) | ||
target_link_libraries(tjs mimalloc-static) | ||
endif() | ||
|
||
add_executable(tjs-cli EXCLUDE_FROM_ALL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't exclude it, it needs to always be built.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you'd like to only build the library, then add some BUILD_ONLY_LIBRARY option please.
Makefile
Outdated
@@ -22,7 +22,7 @@ $(BUILD_DIR): | |||
cmake -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILDTYPE) | |||
|
|||
$(TJS): $(BUILD_DIR) | |||
cmake --build $(BUILD_DIR) -j $(JOBS) | |||
cmake --build $(BUILD_DIR) --target tjs-cli -j $(JOBS) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need this if you don't exclude it.
46793d7
to
124130f
Compare
Should be fixed now, let me know if there's anything else. |
Changes LGTM! Let's see if the CI is happy. |
Hi,
First of all, thanks for all the work on txiki.
Currently only a command-line interface is available, but I would like to embed this javascript runtime in my own application.
Is this change something that you would be open to?
It requires only a small adaptation of the CMakeLists.txt and Makefile.
Let me know what you think.