@@ -135,6 +135,12 @@ function setupMethods (soljson) {
135
135
return sources ;
136
136
}
137
137
138
+ function librariesSupplied ( input ) {
139
+ if ( input [ 'settings' ] !== null ) {
140
+ return input [ 'settings' ] [ 'libraries' ] ;
141
+ }
142
+ }
143
+
138
144
function translateOutput ( output ) {
139
145
output = translate . translateJsonCompilerOutput ( JSON . parse ( output ) ) ;
140
146
if ( output == null ) {
@@ -148,17 +154,20 @@ function setupMethods (soljson) {
148
154
return formatFatalError ( 'Failed to process sources' ) ;
149
155
}
150
156
157
+ // Try linking if libraries were supplied
158
+ var libraries = librariesSupplied ( input ) ;
159
+
151
160
// Try to wrap around old versions
152
161
if ( compileJSONCallback !== null ) {
153
- return translateOutput ( compileJSONCallback ( JSON . stringify ( { 'sources' : sources } ) , isOptimizerEnabled ( input ) , readCallback ) ) ;
162
+ return translateOutput ( compileJSONCallback ( JSON . stringify ( { 'sources' : sources } ) , isOptimizerEnabled ( input ) , readCallback ) , libraries ) ;
154
163
}
155
164
156
165
if ( compileJSONMulti !== null ) {
157
- return translateOutput ( compileJSONMulti ( JSON . stringify ( { 'sources' : sources } ) , isOptimizerEnabled ( input ) ) ) ;
166
+ return translateOutput ( compileJSONMulti ( JSON . stringify ( { 'sources' : sources } ) , isOptimizerEnabled ( input ) ) , libraries ) ;
158
167
}
159
168
160
169
// Try our luck with an ancient compiler
161
- return translateOutput ( compileJSON ( sources [ Object . keys ( sources ) [ 0 ] ] , isOptimizerEnabled ( input ) ) ) ;
170
+ return translateOutput ( compileJSON ( sources [ Object . keys ( sources ) [ 0 ] ] , isOptimizerEnabled ( input ) ) , libraries ) ;
162
171
} ;
163
172
164
173
var version = soljson . cwrap ( 'version' , 'string' , [ ] ) ;
0 commit comments