fix(build): skip linking/archiving for custom and none project kinds

This commit is contained in:
2026-07-18 20:21:41 +08:00
parent 9eaa4635d5
commit 9d030cba0c
3 changed files with 12 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
)?; )?;
let objects = build_objects(compiler, &sources, &obj_dir, ctx, "o", qt_include_path)?; let objects = build_objects(compiler, &sources, &obj_dir, ctx, "o", qt_include_path)?;
if ctx.kind == "none" || ctx.kind == "custom" {
return Ok(common::elapsed_secs(start_time));
}
if ctx.kind == "staticlib" { if ctx.kind == "staticlib" {
return artifact::archive_static(ctx, &objects, start_time); return artifact::archive_static(ctx, &objects, start_time);
} }

View File

@@ -41,6 +41,10 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
}; };
let objects = build_objects(compiler, &sources, &obj_dir, ctx, "obj")?; let objects = build_objects(compiler, &sources, &obj_dir, ctx, "obj")?;
if ctx.kind == "none" || ctx.kind == "custom" {
return Ok(common::elapsed_secs(start_time));
}
if ctx.kind == "staticlib" { if ctx.kind == "staticlib" {
let lib_path = platform::lib_path(ctx.profile, ctx.project_name, ctx.target_dir); let lib_path = platform::lib_path(ctx.profile, ctx.project_name, ctx.target_dir);
if !common::needs_link(&objects, &lib_path) { if !common::needs_link(&objects, &lib_path) {

View File

@@ -51,6 +51,10 @@ where
}; };
let objects = build_objects_common(assembler, &sources, &obj_dir, ctx, &build_object)?; let objects = build_objects_common(assembler, &sources, &obj_dir, ctx, &build_object)?;
if ctx.kind == "none" || ctx.kind == "custom" {
return Ok(common::elapsed_secs(start_time));
}
if ctx.kind == "staticlib" { if ctx.kind == "staticlib" {
return artifact::archive_static(ctx, &objects, start_time); return artifact::archive_static(ctx, &objects, start_time);
} }