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.

CompileStep.h 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #pragma once
  2. #include "DepNode.h"
  3. #include "BXParser.h"
  4. #include "sys.h"
  5. #include "toolchain.h"
  6. class CompileStep: public DepNode {
  7. public:
  8. CompileStep(std::string path, toolchain::FileType type, BXVariables vars):
  9. path_(std::move(path)), type_(type), variables_(std::move(vars)) {}
  10. private:
  11. std::string path_;
  12. toolchain::FileType type_;
  13. bool checkHasChanged(const std::string &outDir) override;
  14. void doBuild(const std::string &outDir) override;
  15. void doWriteCompDB(const std::string &outDir, compdb::Writer &w) override;
  16. std::vector<std::string> getPublicLDFlags(const std::string &outDir) override;
  17. std::vector<std::string> getPublicLDLibs(const std::string &outDir) override;
  18. std::vector<std::string> getPublicObjects(const std::string &outDir) override;
  19. bool hasVariables_ = false;
  20. BXVariables variables_;
  21. BXVariables &variables();
  22. bool hasFlags_ = false;
  23. std::vector<std::string> flags_;
  24. std::vector<std::string> &flags();
  25. bool hasCompileCommand_ = false;
  26. std::vector<std::string> compileCommand_;
  27. std::vector<std::string> &compileCommand(const std::string &outDir);
  28. std::string confPath(const std::string &outDir) {
  29. return outDir + '/' + sys::sanitizePath(path_) + ".bx";
  30. }
  31. };