Skip to content

Commit d3d932a

Browse files
committed
Add way to make debug build
Also, add logging. You can do this with ``` DEBUG=* npm build ``` or windows ``` set DEBUG=* npm build ```
1 parent 03611c9 commit d3d932a

File tree

6 files changed

+9
-4
lines changed

6 files changed

+9
-4
lines changed

build/build.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import fs from 'node:fs';
33

44
import {execute} from './execute.js';
55
import {addElemIf, appendPathIfItExists, prependPathIfItExists} from './utils.js';
6-
6+
77
//const __dirname = dirname(fileURLToPath(import.meta.url));
88
const cwd = process.cwd();
99
const depotToolsPath = path.join(cwd, 'third_party', 'depot_tools');
@@ -32,7 +32,7 @@ async function buildDawnNode() {
3232
...addElemIf(!isWin, '-GNinja'),
3333
'-DDAWN_BUILD_NODE_BINDINGS=1',
3434
'-DDAWN_USE_X11=OFF',
35-
'-DCMAKE_BUILD_TYPE=Release',
35+
`-DCMAKE_BUILD_TYPE=${process.env.CMAKE_BUILD_TYPE ?? 'Release'}`,
3636
...addElemIf(isWin, '-DCMAKE_SYSTEM_VERSION=10.0.26100.0'),
3737
...addElemIf(isMac, '-DCMAKE_OSX_SYSROOT=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk'),
3838
]);

build/execute.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import {spawn} from 'child_process';
2+
import DEBUG from 'debug';
3+
const debug = DEBUG('execute');
24

35
export function execute(cmd, args, options) {
46
return new Promise((resolve, reject) => {
7+
debug(`${cmd} ${args.join(' ')}`);
58
const proc = spawn(cmd, args, {...options || {}, shell: true, stdio: 'inherit'});
69
proc.on('close', function(code) {
710
const result = {exitCode: code};

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"index.js"
2929
],
3030
"devDependencies": {
31+
"debug": "^4.4.0",
3132
"mocha": "^11.0.1"
3233
}
3334
}

third_party/dawn

Submodule dawn updated from cf1b10b to 8dfcfd1

third_party/depot_tools

Submodule depot_tools updated from 24d9ad6 to 1dd73cd

0 commit comments

Comments
 (0)