-
Notifications
You must be signed in to change notification settings - Fork 684
Add a "single" source/header file generation and build mode #2790
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
Conversation
This PR currently depends on the #2789 PR. (That commit is also included in this PR) |
c897762
to
33e89a5
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.
LGTM
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.
IMHO this feature should be included in the tools/build.py
as well. The documentation is also missing and this feature should be mentioned in the "Getting Started" guide (docs/01.GETTING-STARTED.md
). The code looks good, nice improvement.
jerry-core/CMakeLists.txt
Outdated
set(JERRYSCRIPT_SOURCE_CONFIG_H "${CMAKE_CURRENT_SOURCE_DIR}/config.h") | ||
add_custom_command(OUTPUT ${JERRYSCRIPT_CONFIG_H} | ||
COMMAND ${CMAKE_COMMAND} -E copy ${JERRYSCRIPT_SOURCE_CONFIG_H} ${JERRYSCRIPT_CONFIG_H} | ||
DEPENDS ${JERRYSCRIPT_SOURCE_CONFIG_H}) |
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.
This line is misaligned
@LaszloLango I would not add the docs yet, as the |
@galpeter follow up PR is good for me. |
Introduce a new way of building: before any file is compiled all source files are combined into a single C file and all header files into a single H file (per subdir). This new approach makes it possible to quickly integrate JerryScript into other projects: ``` $ gcc -o demo demo.c jerryscript.c jerryscript-port-default.c -lm ``` To use the source generator run: ``` $ cmake -Bbuild_dir -H. -DENABLE_ALL_IN_ONE_SOURCE=ON $ make -C build_dir generate-single-source ``` This will create the following files in the `build_dir`: * jerryscript.c * jerryscript.h * jerryscript-config.h * jerryscript-port-default.c * jerryscript-port-default.h JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
@LaszloLango I've fixed the alignment problem and rebased to master. |
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.
LGTM
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.
LGTM
Introduce a new way of building: before any file is compiled
all source files are combined into a single C file and all
header files into a single H file (per subdir).
This new approach makes it possible to quickly integrate JerryScript
into other projects:
To use the source generator run:
This will create the following files in the
build_dir
: