default_target.lua 647 B

123456789101112131415161718192021222324
  1. -- imports
  2. import("core.project.config")
  3. import("core.project.project")
  4. -- main entry
  5. function main ()
  6. -- load config
  7. config.load()
  8. -- print targets
  9. for _, target in pairs(project.targets()) do
  10. local default = target:get("default")
  11. if (default == nil or default == true) and target:get("kind") == "binary" then
  12. -- denote the start of vscode information to ignore anything logging to stdout before this point
  13. print("__begin__")
  14. print(target:name())
  15. break
  16. end
  17. end
  18. -- print end tag to ignore other deprecated/warnings infos
  19. print("__end__")
  20. end