summaryrefslogtreecommitdiff
path: root/libcppbuild.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libcppbuild.cc')
-rw-r--r--libcppbuild.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/libcppbuild.cc b/libcppbuild.cc
index 46f1bfc..35eff8f 100644
--- a/libcppbuild.cc
+++ b/libcppbuild.cc
@@ -11,20 +11,23 @@
int main(int argc, const char* argv[])
{
Settings settings;
+
+ // TODO: Set from commandline
settings.builddir = "build/foo";
+
std::filesystem::path builddir(settings.builddir);
std::filesystem::create_directories(builddir);
- auto project = configs();
- std::string output = builddir / project.target;
- const auto& files = project.sources;
+ auto config = configs();
+ std::string output = builddir / config.target;
+ const auto& files = config.sources;
std::vector<std::string> objects;
std::vector<Task> tasks;
for(const auto& file : files)
{
- tasks.emplace_back(project, settings, file);
+ tasks.emplace_back(config, settings, file);
objects.push_back(tasks.back().targetFile);
}
@@ -91,7 +94,9 @@ int main(int argc, const char* argv[])
{
objectlist += object + " ";
}
- std::string compiler = "g++ " + objectlist + " -o " + output;
+ std::string compiler = "g++ " + objectlist + " " +
+ config.ldflags + " " +
+ "-o " + output;
std::cout << compiler << "\n";
if(system(compiler.data()))
{