Build tool
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

toolchain.h 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include <vector>
  3. #include <string>
  4. namespace toolchain {
  5. enum FileType {
  6. C, CXX,
  7. };
  8. enum TargetType {
  9. BINARY,
  10. SHARED_LIBRARY,
  11. STATIC_LIBRARY,
  12. };
  13. std::string objectFilePath(const std::string &path, const std::string &outDir);
  14. std::string targetFilePath(
  15. TargetType type,
  16. const std::string &path,
  17. const std::string &outDir);
  18. void getPkgConfigFlags(const std::vector<std::string> &pkgs, std::vector<std::string> &flags);
  19. void getPkgConfigLDLibs(const std::vector<std::string> &pkgs, std::vector<std::string> &flags);
  20. std::vector<std::string> getDependencies(
  21. const std::vector<std::string> &flags,
  22. FileType type,
  23. const std::string &path);
  24. std::vector<std::string> getCompileCommand(
  25. const std::vector<std::string> &flags,
  26. FileType type,
  27. const std::string &path,
  28. const std::string &outDir);
  29. // TODO: Don't rely on FileType, just use LD and let the dependency graph nodes
  30. // provide the necessary flags to link with libstdc++
  31. std::vector<std::string> getLinkCommand(
  32. const std::vector<std::string> &ldFlags,
  33. const std::vector<std::string> &ldLibs,
  34. FileType type,
  35. TargetType targetType,
  36. const std::vector<std::string> &objs,
  37. const std::string &path,
  38. const std::string &outDir);
  39. }