| OLD | NEW |
| 1 # Mojo C++ SDK | 1 # Mojo C++ SDK |
| 2 | 2 |
| 3 This is a minimal SDK for writing/building Mojo applications/services in C++. | 3 This is a minimal SDK for writing/building Mojo applications/services in C++. |
| 4 Currently, it supports building for Linux. (**TODO(vtl)**: Support other | 4 Currently, it supports building for Linux. (**TODO(vtl)**: Support other |
| 5 configurations/targets.) | 5 configurations/targets.) |
| 6 | 6 |
| 7 It includes a simple Makefile that demonstrates building a couple of simple | 7 It includes a simple Makefile that demonstrates building a couple of simple |
| 8 example applications/services (in `examples/hello_mojo`). Note that the Makefile | 8 example applications/services (in `examples/hello_mojo`). Note that the Makefile |
| 9 is intended to be illustrative, and not for maximal correctness or practicality | 9 is intended to be illustrative, and not for maximal correctness or practicality |
| 10 (for example, it does not deal with dependencies correctly). | 10 (for example, it does not deal with dependencies correctly). |
| 11 | 11 |
| 12 Users of the SDK are expected to set up builds in an appropriate way for their | 12 Users of the SDK are expected to set up builds in an appropriate way for their |
| 13 situation, but the Makefile should show the key steps (in particular, generating | 13 situation, but the Makefile should show the key steps (in particular, generating |
| 14 the C++ source files from Mojom files). | 14 the C++ source files from Mojom files). |
| 15 | 15 |
| 16 ## Prerequisites | 16 ## Prerequisites |
| 17 | 17 |
| 18 To fetch the Mojom tool and clang: | 18 To fetch the Mojom tool and clang: |
| 19 * bash | 19 * bash |
| 20 * python 2.7 | 20 * python 2.7 |
| 21 | 21 |
| 22 To build the examples: | 22 To build the examples: |
| 23 * binutils | 23 * binutils |
| 24 * make | 24 * make |
| 25 | 25 |
| 26 ## Set up | 26 ## Set up |
| 27 | 27 |
| 28 To generate code from Mojom files, one needs the Mojom tool. Running the | 28 To get started quickly, just run the following: |
| 29 following causes the binary to be downloaded: | 29 |
| 30 $ mojo_sdk_setup/setup.sh |
| 31 |
| 32 This is equivalent to performing the steps below separately: |
| 30 | 33 |
| 31 $ mojo_sdk_setup/download_mojom_tool.sh | 34 $ mojo_sdk_setup/download_mojom_tool.sh |
| 32 | |
| 33 The included Makefile uses clang. The following downloads a suitable version of | |
| 34 clang: | |
| 35 | |
| 36 $ mojo_sdk_setup/download_clang.sh | 35 $ mojo_sdk_setup/download_clang.sh |
| 37 | 36 |
| 38 (One should be able to build using another compiler with sufficient C++11 | 37 The first downloads a binary for the Mojom tool, which is needed to generate |
| 39 support.) | 38 code from Mojom files. The second downloads a suitable version of clang, which |
| 39 is needed by the included Makefile. (One should also be able to build using |
| 40 another compiler with sufficient C++11 support.) |
| 40 | 41 |
| 41 ## Building the examples | 42 ## Building the examples |
| 42 | 43 |
| 43 To build the included examples: | 44 To build the included examples: |
| 44 | 45 |
| 45 $ make -j8 | 46 $ make -j8 |
| 46 | 47 |
| 47 (or similar). All the build output is put into the `out` subdirectory. The | 48 (or similar). All the build output is put into the `out` subdirectory. The |
| 48 examples themselves are `hello_mojo_client.mojo` and `hello_mojo_server.mojo`. | 49 examples themselves are `hello_mojo_client.mojo` and `hello_mojo_server.mojo`. |
| 49 | 50 |
| 50 ## See also | 51 ## See also |
| 51 | 52 |
| 52 * [The Mojo project on GitHub](https://github.com/domokit/mojo) | 53 * [The Mojo project on GitHub](https://github.com/domokit/mojo) |
| 53 * [Mojo documentation](https://github.com/domokit/mojo/tree/master/docs) | 54 * [Mojo documentation](https://github.com/domokit/mojo/tree/master/docs) |
| OLD | NEW |