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

Filter by extension

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 native_toolchain_rust/lib/native_toolchain_rust.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enum BuildMode {
/// Build in release mode; i.e., `cargo build --release`
release,

/// Build in debug mode; i.e., `cargo build --debug`
/// Build in debug mode; i.e., a regular `cargo build`
debug,
}

Expand Down
9 changes: 6 additions & 3 deletions native_toolchain_rust/lib/src/build_runner.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ interface class RustBuildRunner {
:enableDefaultFeatures,
:extraCargoBuildArgs,
:extraCargoEnvironmentVariables,
buildMode: BuildMode(name: cargoBuildMode),
:buildMode,
) = config;
final crateDirectory = crateDirectoryResolver.resolveCrateDirectory(
rootPath: path.fromUri(input.packageRoot),
Expand All @@ -88,7 +88,10 @@ interface class RustBuildRunner {
toolchainChannel,
'cargo',
'build',
'--$cargoBuildMode',
...switch (buildMode) {
BuildMode.release => ['--release'],
BuildMode.debug => [],
},
'--manifest-path',
manifestPath,
'--package',
Expand All @@ -110,7 +113,7 @@ interface class RustBuildRunner {
final binaryFilePath = path.join(
outputDir,
targetTriple,
cargoBuildMode,
buildMode.name,
targetOS.libraryFileName(crateName, linkMode).replaceAll('-', '_'),
);

Expand Down
Loading