aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libsolidity/interface/StandardCompiler.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp
index 7f3b7a58..88e3b111 100644
--- a/libsolidity/interface/StandardCompiler.cpp
+++ b/libsolidity/interface/StandardCompiler.cpp
@@ -43,9 +43,12 @@ Json::Value StandardCompiler::compileInternal(Json::Value const& _input)
for (auto const& sourceName: sources.getMemberNames())
m_compilerStack.addSource(sourceName, sources[sourceName]["content"].asString());
- // @TODO parse settings
- bool optimize = false;
- unsigned optimizeRuns = 200;
+ Json::Value const& settings = _input.get("settings", Json::Value());
+
+ Json::Value optimizerSettings = settings.get("optimizer", Json::Value());
+ bool optimize = optimizerSettings.get("enabled", Json::Value(false)).asBool();
+ unsigned optimizeRuns = optimizerSettings.get("runs", Json::Value(200u)).asUInt();
+
map<string, h160> libraries;
auto scannerFromSourceName = [&](string const& _sourceName) -> solidity::Scanner const& { return m_compilerStack.scanner(_sourceName); };