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.1KB

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