File tree Expand file tree Collapse file tree 1 file changed +9
-12
lines changed Expand file tree Collapse file tree 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(
305305// / \return true if found, false otherwise
306306bool compilet::find_library (const std::string &name)
307307{
308- std::string tmp ;
308+ std::string library_file_name ;
309309
310310 for (const auto &library_path : library_paths)
311311 {
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" );
317313
318- std::ifstream in (tmp+name+ " .a " );
314+ std::ifstream in (library_file_name );
319315
320316 if (in.is_open ())
321- return !add_input_file (tmp+name+ " .a " );
317+ return !add_input_file (library_file_name );
322318 else
323319 {
324- std::string libname=tmp+ name+ " .so" ;
320+ library_file_name = concat_dir_file (library_path, " lib " + name + " .so" ) ;
325321
326- switch (detect_file_type (libname ))
322+ switch (detect_file_type (library_file_name ))
327323 {
328324 case file_typet::GOTO_BINARY:
329- return !add_input_file (libname );
325+ return !add_input_file (library_file_name );
330326
331327 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;
333330 return warning_is_fatal;
334331
335332 default :
You can’t perform that action at this time.
0 commit comments