File tree 1 file changed +9
-12
lines changed
1 file changed +9
-12
lines changed Original file line number Diff line number Diff line change @@ -305,31 +305,28 @@ bool compilet::add_files_from_archive(
305
305
// / \return true if found, false otherwise
306
306
bool compilet::find_library (const std::string &name)
307
307
{
308
- std::string tmp ;
308
+ std::string library_file_name ;
309
309
310
310
for (const auto &library_path : library_paths)
311
311
{
312
- #ifdef _WIN32
313
- tmp = library_path + " \\ lib" ;
314
- #else
315
- tmp = library_path + " /lib" ;
316
- #endif
312
+ library_file_name = concat_dir_file (library_path, " lib" + name + " .a" );
317
313
318
- std::ifstream in (tmp+name+ " .a " );
314
+ std::ifstream in (library_file_name );
319
315
320
316
if (in.is_open ())
321
- return !add_input_file (tmp+name+ " .a " );
317
+ return !add_input_file (library_file_name );
322
318
else
323
319
{
324
- std::string libname=tmp+ name+ " .so" ;
320
+ library_file_name = concat_dir_file (library_path, " lib " + name + " .so" ) ;
325
321
326
- switch (detect_file_type (libname ))
322
+ switch (detect_file_type (library_file_name ))
327
323
{
328
324
case file_typet::GOTO_BINARY:
329
- return !add_input_file (libname );
325
+ return !add_input_file (library_file_name );
330
326
331
327
case file_typet::ELF_OBJECT:
332
- warning () << " Warning: Cannot read ELF library " << libname << eom;
328
+ warning () << " Warning: Cannot read ELF library " << library_file_name
329
+ << eom;
333
330
return warning_is_fatal;
334
331
335
332
default :
You can’t perform that action at this time.
0 commit comments