diff options
author | Igor Pashev <pashev.igor@gmail.com> | 2019-11-29 11:01:13 +0100 |
---|---|---|
committer | Igor Pashev <pashev.igor@gmail.com> | 2019-11-29 11:10:01 +0100 |
commit | c7902c183e5add19d2dfa5ef8b362d05982605de (patch) | |
tree | 1fc6e5e0628a37f2609a984739d7412c4f27459f | |
parent | 4bc4356afc4049c9386adef677f692b8a387288a (diff) | |
download | mrust-c7902c183e5add19d2dfa5ef8b362d05982605de.tar.gz |
Implement cargo:rustc-flags
Make sure we read the whole line and not truncate on the first space.
-rw-r--r-- | tools/minicargo/manifest.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/minicargo/manifest.cpp b/tools/minicargo/manifest.cpp index 58e70438..d4f3d2ff 100644 --- a/tools/minicargo/manifest.cpp +++ b/tools/minicargo/manifest.cpp @@ -767,7 +767,7 @@ void PackageManifest::load_build_script(const ::std::string& path) while( !is.eof() ) { ::std::string line; - is >> line; + std::getline(is, line); if( line.compare(0, 5+1, "cargo:") == 0 ) { size_t start = 5+1; @@ -832,8 +832,10 @@ void PackageManifest::load_build_script(const ::std::string& path) } // cargo:rustc-flags=-l foo else if( key == "rustc-flags" ) { - // Split on space, then push each. - throw ::std::runtime_error("TODO: rustc-flags"); + std::istringstream iss(value); + for(std::string s; iss >> s;) { + rv.rustc_flags.push_back(s); + } } // cargo:rustc-env=FOO=BAR else if( key == "rustc-env" ) { |