summaryrefslogtreecommitdiff
path: root/libcppbuild.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-11 21:29:09 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-11 21:29:09 +0200
commitee825bf2e966a1b565473753adb3f2b74f6d0ce4 (patch)
tree1c88ce85788c1678f0946d880b0a3737c592e9d7 /libcppbuild.cc
parent6e3070181fadbe47511b52c12af5e1409a9a70b0 (diff)
Flags'n'stuff
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()))
{