diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index c1263231..6f149d8a 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -248,10 +248,18 @@ local flags = config.mapFlags(cfg, gcc.libraryDirectories) -- Scan the list of linked libraries. If any are referenced with - -- paths, add those to the list of library search paths. The call - -- config.getlinks() all includes cfg.libdirs. - for _, dir in ipairs(config.getlinks(cfg, "system", "directory")) do - table.insert(flags, '-L' .. premake.quoted(dir)) + -- paths, add those to the list of library search paths + local done = {} + for _, link in ipairs(config.getlinks(cfg, "system", "fullpath")) do + local dir = path.getdirectory(link) + if #dir > 1 and not done[dir] then + done[dir] = true + if path.isframework(link) then + table.insert(flags, '-F' .. premake.quoted(dir)) + else + table.insert(flags, '-L' .. premake.quoted(dir)) + end + end end if cfg.flags.RelativeLinks then