@@ -161,19 +161,6 @@ private function getLibsString(array $libraries, bool $use_short_libs = true): s
161
161
$ frameworks = [];
162
162
163
163
foreach ($ libraries as $ library ) {
164
- // convert all static-libs to short names
165
- $ libs = Config::getLib ($ library , 'static-libs ' , []);
166
- foreach ($ libs as $ lib ) {
167
- // check file existence
168
- if (!file_exists (BUILD_LIB_PATH . "/ {$ lib }" )) {
169
- throw new WrongUsageException ("Library file ' {$ lib }' for lib [ {$ library }] does not exist in ' " . BUILD_LIB_PATH . "'. Please build it first. " );
170
- }
171
- $ lib_names [] = $ this ->getShortLibName ($ lib );
172
- }
173
- // add frameworks for macOS
174
- if (SPCTarget::getTargetOS () === 'Darwin ' ) {
175
- $ frameworks = array_merge ($ frameworks , Config::getLib ($ library , 'frameworks ' , []));
176
- }
177
164
// add pkg-configs libs
178
165
$ pkg_configs = Config::getLib ($ library , 'pkg-configs ' , []);
179
166
foreach ($ pkg_configs as $ pkg_config ) {
@@ -187,10 +174,24 @@ private function getLibsString(array $libraries, bool $use_short_libs = true): s
187
174
$ pc_libs = array_reverse (PkgConfigUtil::getLibsArray ($ pkg_configs ));
188
175
$ lib_names = [...$ lib_names , ...$ pc_libs ];
189
176
}
177
+ // convert all static-libs to short names
178
+ $ libs = Config::getLib ($ library , 'static-libs ' , []);
179
+ foreach ($ libs as $ lib ) {
180
+ // check file existence
181
+ if (!file_exists (BUILD_LIB_PATH . "/ {$ lib }" )) {
182
+ throw new WrongUsageException ("Library file ' {$ lib }' for lib [ {$ library }] does not exist in ' " . BUILD_LIB_PATH . "'. Please build it first. " );
183
+ }
184
+ $ lib_names [] = $ this ->getShortLibName ($ lib );
185
+ }
186
+ // add frameworks for macOS
187
+ if (SPCTarget::getTargetOS () === 'Darwin ' ) {
188
+ $ frameworks = array_merge ($ frameworks , Config::getLib ($ library , 'frameworks ' , []));
189
+ }
190
190
}
191
191
192
192
// post-process
193
- $ lib_names = array_reverse (array_unique (array_filter ($ lib_names , fn ($ x ) => $ x !== '' )));
193
+ $ lib_names = array_filter ($ lib_names , fn ($ x ) => $ x !== '' );
194
+ $ lib_names = array_reverse (array_unique ($ lib_names ));
194
195
$ frameworks = array_unique ($ frameworks );
195
196
196
197
// process frameworks to short_name
0 commit comments