Skip to content

Commit

Permalink
Add way to make debug build
Browse files Browse the repository at this point in the history
Also, add logging. You can do this with

```
DEBUG=* npm build
```

or windows

```
set DEBUG=*
npm build
```
  • Loading branch information
greggman committed Jan 15, 2025
1 parent 03611c9 commit d3d932a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import fs from 'node:fs';

import {execute} from './execute.js';
import {addElemIf, appendPathIfItExists, prependPathIfItExists} from './utils.js';

//const __dirname = dirname(fileURLToPath(import.meta.url));
const cwd = process.cwd();
const depotToolsPath = path.join(cwd, 'third_party', 'depot_tools');
Expand Down Expand Up @@ -32,7 +32,7 @@ async function buildDawnNode() {
...addElemIf(!isWin, '-GNinja'),
'-DDAWN_BUILD_NODE_BINDINGS=1',
'-DDAWN_USE_X11=OFF',
'-DCMAKE_BUILD_TYPE=Release',
`-DCMAKE_BUILD_TYPE=${process.env.CMAKE_BUILD_TYPE ?? 'Release'}`,
...addElemIf(isWin, '-DCMAKE_SYSTEM_VERSION=10.0.26100.0'),
...addElemIf(isMac, '-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'),
]);
Expand Down
3 changes: 3 additions & 0 deletions build/execute.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {spawn} from 'child_process';
import DEBUG from 'debug';
const debug = DEBUG('execute');

export function execute(cmd, args, options) {
return new Promise((resolve, reject) => {
debug(`${cmd} ${args.join(' ')}`);
const proc = spawn(cmd, args, {...options || {}, shell: true, stdio: 'inherit'});
proc.on('close', function(code) {
const result = {exitCode: code};
Expand Down
1 change: 1 addition & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"index.js"
],
"devDependencies": {
"debug": "^4.4.0",
"mocha": "^11.0.1"
}
}
2 changes: 1 addition & 1 deletion third_party/dawn
Submodule dawn updated from cf1b10 to 8dfcfd
2 changes: 1 addition & 1 deletion third_party/depot_tools
Submodule depot_tools updated from 24d9ad to 1dd73c

0 comments on commit d3d932a

Please sign in to comment.