-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Labels
enhancementNew feature or requestNew feature or requestpriority:highHigh priority issue. Essential to the project's operationHigh priority issue. Essential to the project's operation
Description
IIUC most of the Options are common to all gccrs invocations. So
rustc --crate-type=dyn --crate-type=bin src/<file>.rs --other-flag-1 --other-flag-2becomes
gccrs src/<file>.rs --converted-other-flag-1 --converted-other-flag-2 # bin
gccrs -shared src/<file>.rs -o libfile.so --converted-other-flag-1 --converted-other-flag-2 # shared libwhere --converted-other-flag-1 --converted-other-flag-2 are common to all invocations. So why not only store them once?
pub struct OptionsCollection {
common_args: Vec<Arg>,
crate_types: Vec<CrateType>,
... // Other fields that require multiple gccrs invocations, if any
}I think that would make things way cleaner and would avoid saving the common options and input+output file name N times.
Maybe even:
pub struct Args {
input_files: Vec<String/PathBuf>,
output_file: String/PathBuf,
common_args: Vec<Arg>,
crate_types: Vec<CrateType>,
... // Other fields that require multiple gccrs invocations, if any
}And only once you generate the gccrs commands, you will build the whole Vec<Vec> argument matrix.
Originally posted by @flip1995 in #47 (comment)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpriority:highHigh priority issue. Essential to the project's operationHigh priority issue. Essential to the project's operation