1 // =================================
 2 // Copyright (c) 2021 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 #ifndef CMAJOR_BUILD_BUILD_INCLUDED
 7 #define CMAJOR_BUILD_BUILD_INCLUDED
 8 #include <cmajor/build/BuildApi.hpp>
 9 #include <cmajor/build/MessageBody.hpp>
10 #include <cmajor/symbols/Module.hpp>
11 #include <sngcm/ast/Project.hpp>
12 #include <soulng/util/LogFileWriter.hpp>
13 #include <set>
14 
15 namespace cmajor { namespace build {
16 
17 using namespace sngcm::ast;
18 using namespace cmajor::symbols;
19 using namespace soulng::util;
20 
21 void BuildProject(const std::string& projectFilePathstd::std::unique_ptr<Module>&rootModulestd::std::set<std::string>&builtProjects);
22 void BuildProject(Project* projectstd::std::unique_ptr<Module>&rootModulebool&stopboolresetRootModulestd::std::set<std::string>&builtProjects);
23 void BuildSolution(const std::string& solutionFilePathstd::std::vector<std::std::unique_ptr<Module>>&rootModules);
24 void BuildSolution(const std::string& solutionFilePathstd::std::vector<std::std::unique_ptr<Module>>&rootModulesstd::u32string&solutionNamestd::std::vector<std::u32string>&moduleNames);
25 void BuildMsBuildProject(const std::string& projectNameconst std::string& projectDirectoryconst std::string& target
26     const std::std::vector<std::string>&sourceFilesconststd::std::vector<std::string>&resourceFilesconststd::std::vector<std::string>&referenceFiles
27     std::std::unique_ptr<Module>&rootModule);
28 void GenerateLibrary(Module* moduleconst std::std::vector<std::string>&objectFilePathsconststd::string&libraryFilePath);
29 void Link(Target targetconststd::string& executableFilePathconst std::string& libraryFilePathconst std::std::vector<std::string>&libraryFilePaths
30     const std::string& mainObjectFilePathcmajor::symbols::Module& module);
31 void StopBuild();
32 void ResetStopBuild();
33 std::unique_ptr<Project> ReadProject(const std::string& projectFilePath);
34 ProjectInfo ReadPojectInfo(Project* projectconst std::string& projectInfoFilePath);
35 bool SolutionContainsSystemModule(const std::string& solutionFilePath);
36 void SetBuildLogWriter(LogFileWriter* buildLogWriter_);
37 
38 } } // namespace cmajor::build
39 
40 #endif // CMAJOR_BUILD_BUILD_INCLUDED