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

Side by Side Diff: README.md

Issue 29527808: Noissue - Use meson to build the C++ code (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore/
Patch Set: Now build objects one by one, with dependencies, and share them. Created Oct. 12, 2017, 6:11 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « .hgignore ('k') | meson.build » ('j') | meson.build » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Adblock Plus core 1 Adblock Plus core
2 ================= 2 =================
3 3
4 This repository contains the generic Adblock Plus code that's shared between 4 This repository contains the generic Adblock Plus code that's shared between
5 platforms. This repository is not designed to be used directly, but instead to 5 platforms. This repository is not designed to be used directly, but instead to
6 serve as a dependency for `adblockplus`, `adblockpluschrome` and 6 serve as a dependency for `adblockplus`, `adblockpluschrome` and
7 `libadblockplus`. 7 `libadblockplus`.
8 8
9 Compiling C++ code 9 Compiling C++ code
10 ------------------ 10 ------------------
11 11
12 ### Purpose 12 ### Purpose
13 13
14 In order to improve performance and memory usage, some of the code (located 14 In order to improve performance and memory usage, some of the code (located
15 inside the `compiled` directory) is written in C++ and compiled to JavaScript 15 inside the `compiled` directory) is written in C++ and compiled to JavaScript
16 via Empscripten. 16 via Empscripten.
17 17
18 ### Requirements 18 ### Requirements
19 19
20 * [Emscripten 1.37.3](https://github.com/kripken/emscripten) 20 * [Emscripten 1.37.3](https://github.com/kripken/emscripten)
21 * [Python 2.7](https://www.python.org) 21 * [Python 2.7](https://www.python.org)
22 * [meson](https://www.mesonbuild.com)
23 * [ninja](https://www.ninja-build.org)
22 24
23 ### Running Emscripten 25 ### Running Emscripten
24 26
25 After installing and configuring Emscripten you can run the following command: 27 After installing and configuring Emscripten you can setup the build
28 with the following commands:
26 29
27 python compile 30 meson build
31
32 By default it will make a debug build. Pass `--buildtype release` to
33 make a release build.
Wladimir Palant 2017/10/13 09:45:39 Nit: make => create on both occasions? Seems to so
hub 2017/10/13 18:16:52 Done.
34
35 Then to build just do:
36
37 cd build
38 ninja
39
40 This will regenerate the build files as needed.
28 41
29 This will produce a `lib/compiled.js` exporting the classes defined in C++ code. 42 This will produce a `lib/compiled.js` exporting the classes defined in C++ code.
30 43
31 ### Technical details 44 ### Technical details
32 45
33 Compilation is currently a two-step process. In the bindings generation step, 46 Compilation is currently a two-step process. In the bindings generation step,
34 the source files are compiled into `compiled/bindings.cpp.js` with the 47 the source files are compiled into `compiled/bindings.cpp.js` with the
35 `PRINT_BINDINGS` symbol defined. This application is then executed via Node.js 48 `PRINT_BINDINGS` symbol defined. This application is then executed via Node.js
36 and will print JavaScript wrappers for the C++ classes to 49 and will print JavaScript wrappers for the C++ classes to
37 `compiled/bindings.js` according to definitions within the `EMSCRIPTEN_BINDINGS` 50 `build/bindings.js` according to definitions within the `EMSCRIPTEN_BINDINGS`
38 macro in `compiled/bindings.cpp`. 51 macro in `compiled/bindings.cpp`.
39 52
40 In the actual compilation step the source files are compiled into 53 In the actual compilation step the source files are compiled into
41 `lib/compiled.js` without the `PRINT_BINDINGS` symbol, so that the 54 `lib/compiled.js` without the `PRINT_BINDINGS` symbol, so that the
42 `EMSCRIPTEN_BINDINGS` macro ignores its contents and merely emits some generic 55 `EMSCRIPTEN_BINDINGS` macro ignores its contents and merely emits some generic
43 functions necessary for the JavaScript bindings to work. The previously 56 functions necessary for the JavaScript bindings to work. The previously
44 generated `compiled/bindings.js` file is added to the end of Emscripten output. 57 generated `compiled/bindings.js` file is added to the end of Emscripten output.
45 58
46 The binding generation approach is heavily inspired by 59 The binding generation approach is heavily inspired by
47 [embind](http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_an d_javascript/embind.html). 60 [embind](http://kripken.github.io/emscripten-site/docs/porting/connecting_cpp_an d_javascript/embind.html).
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 Linting 98 Linting
86 ------- 99 -------
87 100
88 You can lint the code using [ESLint](http://eslint.org). 101 You can lint the code using [ESLint](http://eslint.org).
89 102
90 eslint *.js chrome lib test 103 eslint *.js chrome lib test
91 104
92 You will need to set up ESLint and our configuration first, see 105 You will need to set up ESLint and our configuration first, see
93 [eslint-config-eyeo](https://hg.adblockplus.org/codingtools/file/tip/eslint-conf ig-eyeo) 106 [eslint-config-eyeo](https://hg.adblockplus.org/codingtools/file/tip/eslint-conf ig-eyeo)
94 for more information. 107 for more information.
OLDNEW
« no previous file with comments | « .hgignore ('k') | meson.build » ('j') | meson.build » ('J')

Powered by Google App Engine
This is Rietveld