提交 46b988e1 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add BUILDING documentation

上级 f646b7c5
# Building
This document is intended for **mediasoup** developers.
## Makefile
The root folder of the project contains a `Makefile` to build the mediasoup worker subproject (under the `worker/` folder).
### `make Release`
Builds the production ready mediasoup worker binary at `worker/out/Release/`. This is the binary used in production when installing the **mediasoup** NPM module with `npm install mediasoup`.
### `make Debug`
Builds a more verbose mediasoup and less optimized worker binary at `worker/out/Debug/` with some C flags (such as `-g` and `-O0`) and such defined macros (such as `DEBUG`, `MS_LOG_FILE_LINE` and `MS_LOG_TRACE`).
Check the meaning of these macros in the [Logger.h](worker/include/Logger.h) header file.
In order to instruct the **mediasoup** Node.js module to use the `Debug` mediasoup worker binary, an environment variable must be set before running the Node.js application or the internal test units:
```bash
$ MEDIASOUP_BUILDTYPE=Debug node myapp.js
```
Or, in order to run the internal test units with the `Debug` mediasoup worker:
```bash
$ MEDIASOUP_BUILDTYPE=Debug gulp test-debug
```
### `make xcode`
Builds a Xcode project for the mediasoup worker subproject.
### `make clean`
Cleans objects and binaries related to the mediasoup worker.
### `make clean-all`
Clean all the objects and binaries, including those generated for library dependencies (such as libuv, openssl and libsrtp).
### `make`
The default task runs the `Release` task.
## gulpfile.js
**mediasoup** comes with a `gulpfile.js` file to enable [gulp](https://www.npmjs.com/package/gulp) tasks.
In order to tun these tasks, `gulp-cli` must be globally installed:
```bash
$ npm install -g gulp-cli
```
### `gulp lint`
Validates the JavaScript code.
### `gulp capabilities`
Reads **mediasoup** [media capabilities](data/supportedCapabilities) and inserts them into the worker C++ code. After that, `make Release` or `make Debug` must be called.
### `gulp test`
Run the internal [test units](test/).
### `gulp test-debug`
Run the internal [test units](test/) in a more verbose fashion. Note however that running this task does not use the `Debug` mediasoup worker binary. If you wish to use it, set the `MEDIASOUP_BUILDTYPE` environment variable as explained above.
### `gulp`
The default task runs the `link` task.
...@@ -47,10 +47,6 @@ gulp.task('capabilities', () => ...@@ -47,10 +47,6 @@ gulp.task('capabilities', () =>
.pipe(touch()); .pipe(touch());
}); });
gulp.task('worker', shell.task(
[ 'make' ]
));
gulp.task('test', shell.task( gulp.task('test', shell.task(
[ `tap --bail --color --reporter=spec ${tests.join(' ')}` ], [ `tap --bail --color --reporter=spec ${tests.join(' ')}` ],
{ {
...@@ -61,15 +57,9 @@ gulp.task('test', shell.task( ...@@ -61,15 +57,9 @@ gulp.task('test', shell.task(
gulp.task('test-debug', shell.task( gulp.task('test-debug', shell.task(
[ `tap --bail --reporter=tap ${tests.join(' ')}` ], [ `tap --bail --reporter=tap ${tests.join(' ')}` ],
{ {
env : { DEBUG: '*ERROR* *WARN*' }, env : { DEBUG: '*WARN* *ERROR* *ABORT*' },
verbose : true verbose : true
} }
)); ));
gulp.task('t', gulp.series('test'));
gulp.task('td', gulp.series('test-debug'));
gulp.task('make', gulp.series('capabilities', 'worker'));
gulp.task('default', gulp.series('lint')); gulp.task('default', gulp.series('lint'));
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论