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

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "DepNode.h"
  3. #include "BXParser.h"
  4. #include "toolchain.h"
  5. class CompileStep: public DepNode {
  6. public:
  7. CompileStep(std::string path, toolchain::FileType type, BXVariables 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. void doWriteCompDB(const std::string &outDir, compdb::Writer &w) override;
  15. std::vector<std::string> getPublicLDFlags(const std::string &outDir) override;
  16. std::vector<std::string> getPublicLDLibs(const std::string &outDir) override;
  17. std::vector<std::string> getPublicObjects(const std::string &outDir) override;
  18. bool hasVariables_ = false;
  19. BXVariables variables_;
  20. BXVariables &variables();
  21. bool hasFlags_ = false;
  22. std::vector<std::string> flags_;
  23. std::vector<std::string> &flags();
  24. bool hasCompileCommand_ = false;
  25. std::vector<std::string> compileCommand_;
  26. std::vector<std::string> &compileCommand(const std::string &outDir);
  27. std::string confPath(const std::string &outDir) { return outDir + '/' + path_ + ".bx"; }
  28. };