find_gdb.lua 612 B

12345678910111213141516171819202122
  1. import("detect.sdks.find_mingw")
  2. import("lib.detect.find_tool")
  3. function main ()
  4. local paths = {}
  5. if is_host("windows") then
  6. local mingw = find_mingw()
  7. if mingw and mingw.bindir then
  8. table.insert(paths, mingw.bindir)
  9. end
  10. end
  11. local gdb = find_tool("gdb", {norun = true, paths = paths})
  12. if gdb and gdb.program then
  13. local program = gdb.program
  14. if is_host("windows") and not program:endswith(".exe") then
  15. program = program .. ".exe"
  16. end
  17. if os.isfile(program) then
  18. print(program)
  19. end
  20. end
  21. end