Start supporting dict and json types.
This commit is contained in:
parent
94fcc42aed
commit
5183aa821a
32 changed files with 288 additions and 247 deletions
|
@ -26,18 +26,18 @@ BuildSession::BuildSession(const String& source_dir,
|
|||
Status BuildSession::scan()
|
||||
{
|
||||
LOG_INFO("Scanning sources at:" << m_source_dir);
|
||||
Vector<FileSystemPath> ini_files;
|
||||
Vector<FileSystemPath> yaml_files;
|
||||
STATUS_CHECK(Directory::getFilesWithExtension(
|
||||
m_source_dir,
|
||||
".ini",
|
||||
ini_files,
|
||||
".yaml",
|
||||
yaml_files,
|
||||
true), "Error looking for build files");
|
||||
|
||||
for(const auto& ini_file : ini_files)
|
||||
for(const auto& yaml_file : yaml_files)
|
||||
{
|
||||
if (ini_file.file_name() == "build")
|
||||
if (yaml_file.file_name() == "build")
|
||||
{
|
||||
STATUS_CHECK(add_library(ini_file),
|
||||
STATUS_CHECK(add_library(yaml_file),
|
||||
"Error adding library");
|
||||
}
|
||||
}
|
||||
|
@ -55,14 +55,20 @@ Status BuildSession::add_library(const FileSystemPath& config_path)
|
|||
|
||||
Status BuildSession::build()
|
||||
{
|
||||
LOG_INFO("Creating dir: " << m_build_dir);
|
||||
Directory::create(m_build_dir, true);
|
||||
for(auto& library : m_libraries)
|
||||
{
|
||||
const auto run_status = compile_library(library);
|
||||
auto run_status = compile_library(library);
|
||||
if (!run_status.ok())
|
||||
{
|
||||
return run_status;
|
||||
}
|
||||
run_status = create_archive(library);
|
||||
if (!run_status.ok())
|
||||
{
|
||||
return run_status;
|
||||
}
|
||||
//break;
|
||||
}
|
||||
return {};
|
||||
|
@ -82,6 +88,25 @@ Status BuildSession::compile_library(BuildLibrary& lib)
|
|||
return {};
|
||||
}
|
||||
|
||||
Status BuildSession::create_archive(BuildLibrary& lib)
|
||||
{
|
||||
Vector<String> args;
|
||||
args.push_back("rcs");
|
||||
|
||||
auto name = "lib" + lib.get_name() + ".a";
|
||||
args.push_back(name);
|
||||
|
||||
for(const auto& source : lib.get_sources())
|
||||
{
|
||||
const auto output_path = m_build_dir / source.file_name();
|
||||
const auto output_file = output_path.str() + ".o";
|
||||
args.push_back(output_file);
|
||||
}
|
||||
|
||||
LOG_INFO("Archiving " << name);
|
||||
return Process::launch(m_archive_command, args);
|
||||
}
|
||||
|
||||
Status BuildSession::compile_source_file(const FileSystemPath& source,
|
||||
const BuildLibrary& lib)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue