Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: README.md

Issue 29527808: Noissue - Use meson to build the C++ code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Properly build with DEBUG Created Nov. 24, 2017, 8:14 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « .hgignore ('k') | meson.build » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: README.md
===================================================================
--- a/README.md
+++ b/README.md
@@ -13,33 +13,45 @@
In order to improve performance and memory usage, some of the code (located
inside the `compiled` directory) is written in C++ and compiled to JavaScript
via Empscripten.
### Requirements
* [Emscripten 1.37.3](https://github.com/kripken/emscripten)
-* [Python 2.7](https://www.python.org)
+* [Python 2.7 & 3](https://www.python.org)
+* [meson 0.40.0+](https://www.mesonbuild.com)
sergei 2017/12/12 17:37:29 Can we set the version to exactly 0.43.0 because i
hub 2017/12/13 20:28:59 I pinned 0.43.0 in the current patch. I'm not con
Wladimir Palant 2017/12/14 10:57:01 Is there an issue on it already? If not, can you f
sergei 2017/12/14 14:22:46 Done, https://github.com/mesonbuild/meson/issues/2
+* [ninja](https://www.ninja-build.org)
sergei 2017/12/12 17:37:29 Could you please add that ninja executable should
hub 2017/12/13 20:28:59 This conflict with Wladimir saying we shouldn't ha
### Running Emscripten
-After installing and configuring Emscripten you can run the following command:
+After installing and configuring Emscripten you can setup the build
+with the following commands:
+
+ meson build
- python compile
+By default it will create a debug build. Pass `--buildtype release` to
+create a release build.
+
+Then to build just do:
+
+ ninja -C build
+
+This will regenerate the build files as needed.
This will produce a `lib/compiled.js` exporting the classes defined in C++ code.
### Technical details
Compilation is currently a two-step process. In the bindings generation step,
the source files are compiled into `compiled/bindings.cpp.js` with the
`PRINT_BINDINGS` symbol defined. This application is then executed via Node.js
and will print JavaScript wrappers for the C++ classes to
-`compiled/bindings.js` according to definitions within the `EMSCRIPTEN_BINDINGS`
+`build/bindings.js` according to definitions within the `EMSCRIPTEN_BINDINGS`
macro in `compiled/bindings.cpp`.
In the actual compilation step the source files are compiled into
`lib/compiled.js` without the `PRINT_BINDINGS` symbol, so that the
`EMSCRIPTEN_BINDINGS` macro ignores its contents and merely emits some generic
functions necessary for the JavaScript bindings to work. The previously
generated `compiled/bindings.js` file is added to the end of Emscripten output.
« no previous file with comments | « .hgignore ('k') | meson.build » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld