-
Notifications
You must be signed in to change notification settings - Fork 684
Re-thinking the build system to bring it more into line with the conv… #1192
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
Re-thinking the build system to bring it more into line with the conv… #1192
Conversation
This patch is not a final version, the python scripts have to be developed and update is needed for the Makefiles of the external targets after these changes. |
But people can give their feedback earlier. |
6c2c267
to
b1c6e02
Compare
# Compile/link flags | ||
# build mode specific compile/link flags | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Release") |
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.
No need for the if.
CMAKE_C_FLAGS_RELEASE
will only be used when the build type is Release
.
|
b1c6e02
to
dc2aeaf
Compare
We updated this patch based on the comments and we finished the missing tool scripts. |
set(DEFINES_JERRY | ||
${DEFINES_JERRY} | ||
JERRY_ENABLE_SNAPSHOT_SAVE | ||
JERRY_ENABLE_SNAPSHOT_EXEC |
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.
Does snapshot always set?
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.
Yes, it does. This behaviour is similiar to the current one.
But this is unnecessary, so we made this defines optionally.
If both of them are disabled, then the size of Thumb-2 binary on RPi2 is reduced by ~3.5Kbyte.
I like this python based master script far more than the make based. |
@robertsipka, the PR has conflicts. Please rebase to the current master. |
dc2aeaf
to
77378b7
Compare
I've rebased this patch with master and updated it based on your comments. |
Is this still a WIP patch? |
|
||
# Setup directories | ||
# Project binary dir | ||
set(PROJECT_BINARY_DIR ${CMAKE_BINARY_DIR}) |
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.
CMake variables should be quoted. See also: #472
"${CMAKE_BINARY_DIR}"
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib/) | ||
|
||
# Executable output directory | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin/) |
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.
ditto
Please check the CMake variables and use quote chars, if they can contain space character (like storing path). |
77378b7
to
cf27a0f
Compare
Thank you for the hard work. LGTM |
Wow nice, I really like this patch. I just gave this a try and did a "python tools/build.py" and a couple seconds later I have my JerryScript binary. That's exactly the "works out of the box" experience we want to have :) |
@@ -11,20 +11,20 @@ before_install: | |||
|
|||
install: | |||
|
|||
script: "make -j VERBOSE=1 NINJA=1 $TARGET" | |||
script: "python tools/run-tests.py $OPTS" | |||
|
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.
Not sure whether it makes much of a difference given our small project size but it would be great if Travis CI could still use Ninja for the build :)
Great patch! LGTM from my side. |
The difficulty with STM32 is the board support package cannot be downloaded without human intervention (accepting license) anymore, and it is unnecessary for those who does not target those systems. So we will add it back as a port, and those who wish to use it requires to perform some steps. I think this is a balanced approach. |
Yes, expecting the users to download the files manually is perfectly fine. |
Nice Patch! LGTM |
…entions. We removed that implementation where the build directory isn't set up to build with exactly one configuration of the project but potentially several variants: the same build directory can/must be used for debug and release builds, for full or compact profile versions, etc. So we reworked the CMakeLists, and now one build dir deal with exactly one configuration of the project's libraries and tools. JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected] JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]
cf27a0f
to
ddab1d8
Compare
Thanks, I've updated this patch based on your comments. |
@robertsipka Thanks! I think the patch is now ready to go in :) |
…entions.
We removed that implementation where the build directory isn't set up to build with exactly one
configuration of the project but potentially several variants: the same build directory
can/must be used for debug and release builds, for full or compact profile versions, etc.
So we reworked the CMakeLists, and now one build dir deal with exactly one configuration
of the project's libraries and tools.
JerryScript-DCO-1.0-Signed-off-by: Zsolt Borbély [email protected]
JerryScript-DCO-1.0-Signed-off-by: Robert Sipka [email protected]