diff options
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index e537b413d16..5d1326e5aca 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -190,6 +190,11 @@ Session::handle_option ( } break; + case OPT_frust_extern_: { + std::string input (arg); + ret = handle_extern_option (input); + } + break; case OPT_frust_crate_: // set the crate name if (arg != nullptr) @@ -250,6 +255,20 @@ Session::handle_option ( } bool +Session::handle_extern_option (std::string &input) +{ + auto pos = input.find ('='); + if (std::string::npos == pos) + return false; + + std::string libname = input.substr (0, pos); + std::string path = input.substr (pos + 1); + + extern_crates.insert ({libname, path}); + return true; +} + +bool Session::handle_cfg_option (std::string &input) { std::string key; |