diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-03-17 20:30:29 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-04-21 02:38:00 +0800 |
commit | 81775b2df6e624ee9b09f7405d8c0d912d873e5b (patch) | |
tree | 46a7f42c58a59978e786fc9f20c93f4a8c070bd1 /libsolidity/interface/StandardCompiler.cpp | |
parent | 13fa440d37582f80a144b3848340fceb5c55e88d (diff) | |
download | dexon-solidity-81775b2df6e624ee9b09f7405d8c0d912d873e5b.tar.gz dexon-solidity-81775b2df6e624ee9b09f7405d8c0d912d873e5b.tar.zst dexon-solidity-81775b2df6e624ee9b09f7405d8c0d912d873e5b.zip |
Parse libraries in StandardCompiler
Diffstat (limited to 'libsolidity/interface/StandardCompiler.cpp')
-rw-r--r-- | libsolidity/interface/StandardCompiler.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 88e3b111..fd697716 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -50,6 +50,14 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input) unsigned optimizeRuns = optimizerSettings.get("runs", Json::Value(200u)).asUInt(); map<string, h160> libraries; + Json::Value jsonLibraries = settings.get("libraries", Json::Value()); + for (auto const& sourceName: jsonLibraries.getMemberNames()) + { + auto const& jsonSourceName = jsonLibraries[sourceName]; + for (auto const& library: jsonSourceName.getMemberNames()) + // @TODO use libraries only for the given source + libraries[library] = h160(jsonSourceName[library].asString()); + } auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compilerStack.scanner(_sourceName); }; |