Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
decahedron1 committed Dec 16, 2024
1 parent 70851fd commit 55a25a2
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ await new Command()
return;
}

const compilerFlags = [];
const args = [];
if (options.cuda) {
args.push('-Donnxruntime_USE_CUDA=ON');
Expand Down Expand Up @@ -187,7 +188,7 @@ await new Command()
switch (platform) {
case 'win32':
args.push('-A', 'ARM64');
args.push('-DCMAKE_CXX_FLAGS=-D_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS');
compilerFlags.push('_SILENCE_ALL_CXX23_DEPRECATION_WARNINGS');
break;
case 'linux':
args.push(`-DCMAKE_TOOLCHAIN_FILE=${join(root, 'toolchains', 'aarch64-unknown-linux-gnu.cmake')}`);
Expand Down Expand Up @@ -230,8 +231,19 @@ await new Command()
}
}

// https://github.com/microsoft/onnxruntime/pull/21005
if (platform === 'win32') {
compilerFlags.push('_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR');
}

args.push('-Donnxruntime_BUILD_UNIT_TESTS=OFF');

if (compilerFlags.length > 0) {
const allFlags = compilerFlags.map(def => `-D${def}`).join(' ');
args.push(`-DCMAKE_C_FLAGS=${allFlags}`);
args.push(`-DCMAKE_CXX_FLAGS=${allFlags}`);
}

const sourceDir = options.static ? join(root, 'src', 'static-build') : 'cmake';
const outDir = join(root, 'output');

Expand Down

0 comments on commit 55a25a2

Please sign in to comment.