Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ jobs:
if: startsWith(matrix.config.os, 'windows')
uses: GuillaumeFalourd/setup-windows10-sdk-action@v2
with:
s dk-version: 26100
sdk-version: 26100

- name: Install dependencies on ubuntu
if: startsWith(matrix.config.name, 'Ubuntu')
Expand Down
7 changes: 4 additions & 3 deletions build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const kDepotToolsPath = path.join(kCwd, 'third_party', 'depot_tools');
const kDawnPath = `${kCwd}/third_party/dawn`;
const kOutDir = 'out/cmake-release';
const kBuildPath = `${kDawnPath}/${kOutDir}`
const kConfig = process.env.CMAKE_BUILD_TYPE ?? 'Release';

const isMac = process.platform === 'darwin';
const isWin = process.platform === 'win32';
Expand All @@ -31,7 +32,7 @@ async function compile() {
await processThenRestoreCWD(async () => {
process.chdir(kBuildPath);
if (isWin) {
await execute('cmake', ['--build', '.', '--target', 'dawn_node'])
await execute('cmake', ['--build', '.', '--target', 'dawn_node', '--config', kConfig]);
} else {
await execute('ninja', ['dawn.node']);
}
Expand All @@ -56,15 +57,15 @@ async function createProject() {
...addElemIf(!isWin, '-GNinja'),
'-DDAWN_BUILD_NODE_BINDINGS=1',
'-DDAWN_USE_X11=OFF',
`-DCMAKE_BUILD_TYPE=${process.env.CMAKE_BUILD_TYPE ?? 'Release'}`,
`-DCMAKE_BUILD_TYPE=${kConfig}`,
...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'),
]);
});
}

async function copyResult(filepath, target) {
const srcFilename = path.join(...[filepath, ...addElemIf(isWin, 'Debug'), 'dawn.node']);
const srcFilename = path.join(...[filepath, ...addElemIf(isWin, kConfig), 'dawn.node']);
const dstFilename = path.join('dist', `${target}.dawn.node`);
fs.mkdirSync(path.dirname(dstFilename), {recursive: true});
fs.copyFileSync(srcFilename, dstFilename);
Expand Down
Loading