summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorJohn Hodge (Mutabah) <acessdev@gmail.com>2018-02-11 15:33:08 +0800
committerGitHub <noreply@github.com>2018-02-11 15:33:08 +0800
commit6caf5739a97774b2602106e616db75e8a0ad5f8a (patch)
tree9d16f869bbff27743fe7c233fba9c4665a4d9138 /src/main.cpp
parent9e864a5d3ea05706ea6c7f68e47d32629a2c877e (diff)
parent3718f8cb7ee7b8c93e4d69b9aa2e00b4f50efd62 (diff)
downloadmrust-6caf5739a97774b2602106e616db75e8a0ad5f8a.tar.gz
Merge pull request #52 from thepowersgang/common_layout
Merge "common_layout" branch
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 7fa5e765..ea095367 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -185,6 +185,7 @@ struct ProgramParams
bool full_validate_early = false;
} debug;
struct {
+ ::std::string codegen_type;
::std::string emit_build_command;
} codegen;
@@ -603,6 +604,7 @@ int main(int argc, char *argv[])
// - MIR Exportable (public generic, #[inline], or used by a either of those)
// - Require codegen (public or used by an exported function)
TransOptions trans_opt;
+ trans_opt.mode = params.codegen.codegen_type == "" ? "c" : params.codegen.codegen_type;
trans_opt.build_command_file = params.codegen.emit_build_command;
trans_opt.opt_level = params.opt_level;
for(const char* libdir : params.lib_search_dirs ) {
@@ -782,6 +784,10 @@ ProgramParams::ProgramParams(int argc, char *argv[])
get_optval();
this->codegen.emit_build_command = optval;
}
+ else if( optname == "codegen-type" ) {
+ get_optval();
+ this->codegen.codegen_type = optval;
+ }
else if( optname == "emit-depfile" ) {
get_optval();
this->emit_depfile = optval;