Skip to content

Commit

Permalink
[unity]构建脚本加上with_inspector thread_safe选项
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Sep 13, 2024
1 parent e2e21ee commit 1dade64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions unity/cli/cmd.mts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ program
.option("--backend <backend>", "the JS backend will be used", "v8_9.4")
.option('-ws, --websocket <number>', 'with websocket support')
.option('-G, --generator <generator-name>', 'cmake generator name')
.option('-ts, --thread_safe', 'thread safe')
.option('-wi, --with_inspector', 'with inspector')
.action(function (quickcommand, options) {
let backend = options.backend;
let config = options.config;
Expand Down
11 changes: 8 additions & 3 deletions unity/cli/make.mts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ interface BuildOptions {
arch: 'x64' | 'ia32' | 'armv7' | 'arm64' | 'wasm32' | 'auto',
backend: string,
websocket?: number,
generator?: string
generator?: string,
with_inspector?: boolean,
thread_safe?: boolean
}

//// 脚本 scripts
Expand Down Expand Up @@ -260,10 +262,13 @@ async function runPuertsMake(cwd: string, options: BuildOptions) {
console.log("=== Puer ===");
return;
}
if (options.config == 'Debug') {
BackendConfig.definition = BackendConfig.definition || [];
BackendConfig.definition = BackendConfig.definition || [];
if (options.config == 'Debug' || options.with_inspector) {
BackendConfig.definition.push("WITH_INSPECTOR");
}
if (options.thread_safe) {
BackendConfig.definition.push("THREAD_SAFE");
}
const definitionD = (BackendConfig.definition || []).join(';')
const linkD = (BackendConfig['link-libraries'][options.platform]?.[options.arch] || []).join(';')
const incD = (BackendConfig.include || []).join(';')
Expand Down

0 comments on commit 1dade64

Please sign in to comment.