From c7902c183e5add19d2dfa5ef8b362d05982605de Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Fri, 29 Nov 2019 11:01:13 +0100 Subject: Implement cargo:rustc-flags Make sure we read the whole line and not truncate on the first space. --- tools/minicargo/manifest.cpp | 8 +++++--- 1 file 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" ) { -- cgit v1.2.3