mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 11:48:36 +00:00
Custom output directory via build.target
This commit is contained in:
@@ -37,8 +37,11 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
for flag in ctx.ldflags {
|
||||
cmd.arg(flag);
|
||||
}
|
||||
cmd.arg("-o")
|
||||
.arg(platform::bin_path(ctx.profile, ctx.project_name));
|
||||
cmd.arg("-o").arg(platform::bin_path(
|
||||
ctx.profile,
|
||||
ctx.project_name,
|
||||
ctx.target_dir,
|
||||
));
|
||||
|
||||
match cmd.status() {
|
||||
Ok(status) if status.success() => {
|
||||
|
||||
@@ -37,8 +37,11 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
for flag in ctx.ldflags {
|
||||
cmd.arg(flag);
|
||||
}
|
||||
cmd.arg("-o")
|
||||
.arg(platform::bin_path(ctx.profile, ctx.project_name));
|
||||
cmd.arg("-o").arg(platform::bin_path(
|
||||
ctx.profile,
|
||||
ctx.project_name,
|
||||
ctx.target_dir,
|
||||
));
|
||||
|
||||
match cmd.status() {
|
||||
Ok(status) if status.success() => {
|
||||
|
||||
@@ -8,6 +8,7 @@ pub struct BuildContext<'a> {
|
||||
pub compiler: &'a str,
|
||||
pub language: &'a str,
|
||||
pub standard: &'a str,
|
||||
pub target_dir: Option<&'a str>,
|
||||
pub include_dirs: &'a [String],
|
||||
pub lib_dirs: &'a [String],
|
||||
pub libs: &'a [String],
|
||||
|
||||
@@ -63,7 +63,7 @@ pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||
}
|
||||
cmd.arg(format!(
|
||||
"/Fe:{}",
|
||||
platform::bin_path(ctx.profile, ctx.project_name)
|
||||
platform::bin_path(ctx.profile, ctx.project_name, ctx.target_dir)
|
||||
));
|
||||
|
||||
match cmd.status() {
|
||||
|
||||
Reference in New Issue
Block a user