Build tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

toolchain.h 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. #include "SourceFile.h"
  5. namespace toolchain {
  6. enum TargetType {
  7. BINARY,
  8. SHARED_LIBRARY,
  9. STATIC_LIBRARY,
  10. };
  11. std::string objectFilePath(
  12. const std::string &srcDir,
  13. const std::string &name,
  14. const std::string &outDir);
  15. std::string targetFilePath(
  16. TargetType type,
  17. const std::string &name,
  18. const std::string &outDir);
  19. void getPkgConfigFlags(const std::vector<std::string> &pkgs, std::vector<std::string> &flags);
  20. void getPkgConfigLDLibs(const std::vector<std::string> &pkgs, std::vector<std::string> &flags);
  21. void getDependencies(
  22. const std::vector<std::string> &flags,
  23. SourceFile::FileType type,
  24. const std::string &srcDir,
  25. const std::string &name,
  26. std::vector<std::string> &deps);
  27. std::vector<std::string> getCompileCommand(
  28. const std::vector<std::string> &flags,
  29. SourceFile::FileType type,
  30. const std::string &srcDir,
  31. const std::string &name,
  32. const std::string &outDir);
  33. void compile(
  34. const std::vector<std::string> &flags,
  35. SourceFile::FileType type,
  36. const std::string &srcDir,
  37. const std::string &name,
  38. const std::string &outDir);
  39. void link(
  40. const std::string &name,
  41. const std::vector<std::string> &ldFlags,
  42. const std::vector<std::string> &ldLibs,
  43. SourceFile::FileType type,
  44. TargetType targetType,
  45. const std::vector<std::string> &objs,
  46. const std::string &outDir);
  47. }