summaryrefslogtreecommitdiff
path: root/task.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2021-06-12 13:14:01 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2021-06-12 13:14:01 +0200
commit4fad20f754c754b6bd1cacadc3016babb3188bcf (patch)
tree119101ea62d90dde7d6d6da89b651c52f6835d33 /task.cc
parentee825bf2e966a1b565473753adb3f2b74f6d0ce4 (diff)
Comparison using dg sources
Diffstat (limited to 'task.cc')
-rw-r--r--task.cc13
1 files changed, 10 insertions, 3 deletions
diff --git a/task.cc b/task.cc
index 19e4712..4dcbbd8 100644
--- a/task.cc
+++ b/task.cc
@@ -156,9 +156,16 @@ void Task::start()
if(recompile)
{
- std::string cmd =
- "g++ -MMD -c " + std::string(sourceFile) + " " +
- config.cxxflags + " " +
+ std::string comp = "g++";
+ std::string flags = config.cxxflags;
+ if(std::string(sourceFile.extension()) == ".c")
+ {
+ comp = "gcc";
+ flags = config.cflags;
+ }
+ std::string cmd = comp +
+ " -MMD -c " + std::string(sourceFile) + " " +
+ flags + " " +
"-o " + std::string(targetFile);
std::cout << cmd << "\n";