diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-10 07:59:51 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-07-06 07:39:33 +0200 |
commit | 7c24c5d0de4d3584d6d2f9f3c26b4d757b0a0df2 (patch) | |
tree | 81585a1be9126c4bc1be946e74b4b6e1d706279b /backend/ninja/Ninja.hpp | |
parent | 6b238d4bc3c142f6337a73d858e069cae778dc54 (diff) |
Fix sibs test not including parent library correctly
Refactor config parsing to reduce number of changes when introducing a
new platform to support
Diffstat (limited to 'backend/ninja/Ninja.hpp')
-rw-r--r-- | backend/ninja/Ninja.hpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/backend/ninja/Ninja.hpp b/backend/ninja/Ninja.hpp index 8606708..2928fb3 100644 --- a/backend/ninja/Ninja.hpp +++ b/backend/ninja/Ninja.hpp @@ -43,25 +43,27 @@ namespace backend void addGlobalIncludeDirs(const std::string &globalIncludeDirs); void addSourceFile(sibs::Language language, const char *filepath); - void addTestSourceDir(const char *dir); + void setTestSourceDir(const char *dir); void addDependency(const std::string &binaryFile); + void addDynamicDependency(const std::string &dependency); void addSubProject(Ninja *subProject, sibs::SibsConfig *config, sibs::FileString &&buildPath); const std::vector<sibs::SourceFile>& getSourceFiles() const; sibs::Result<bool> build(const sibs::SibsConfig &config, const _tinydir_char_t *savePath, sibs::LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc = nullptr, sibs::LinkerFlagCallbackFunc dynamicLinkerFlagCallback = nullptr, sibs::GlobalIncludeDirCallbackFunc globalIncludeDirCallback = nullptr); private: sibs::Result<bool> buildSubProjects(sibs::LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, sibs::LinkerFlagCallbackFunc dynamicLinkerFlagCallback, sibs::GlobalIncludeDirCallbackFunc globalIncludeDirCallback); - sibs::Result<bool> buildTests(const std::string &projectGeneratedBinaryFlags, const sibs::SibsConfig &config, const _tinydir_char_t *savePath, const std::string &parentDependencyExportIncludeDirs); + sibs::Result<bool> buildTests(const std::string &parentLinkerFlags, const std::string &parentGeneratedLib, const sibs::SibsConfig &config, const _tinydir_char_t *savePath, const std::string &parentDependencyExportIncludeDirs); bool containsSourceFile(const std::string &filepath) const; - bool containsTestSourceDir(const std::string &dir) const; bool containsDependency(const std::string &dependency) const; + bool containsDynamicDependency(const std::string &dependency) const; sibs::Result<bool> getLinkerFlags(const sibs::SibsConfig &config, sibs::LinkerFlagCallbackFunc staticLinkerFlagCallbackFunc, sibs::LinkerFlagCallbackFunc dynamicLinkerFlagCallback, sibs::GlobalIncludeDirCallbackFunc globalIncludeDirCallback, sibs::CflagsCallbackFunc cflagsCallbackFunc) const; sibs::Result<bool> compile(const _tinydir_char_t *buildFilePath); sibs::Result<bool> buildCompilationDatabase(const _tinydir_char_t *buildFilePath, const sibs::FileString &savePath); private: std::string customGlobalIncludeDirs; + std::string testSourceDir; std::vector<sibs::SourceFile> sourceFiles; - std::vector<std::string> testSourceDirs; std::vector<std::string> binaryDependencies; + std::vector<std::string> dynamicDependencies; std::vector<NinjaSubProject> subProjects; }; } |