diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-26 20:46:23 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2021-08-26 20:46:23 +0200 |
commit | 3c6e5ff32fd24acf5e1deb62860ddd7b864066b3 (patch) | |
tree | b06fa4ff4c3b96f5e1de3a23e1a3c9fe694098c0 /task_cc.cc | |
parent | 9c5ba2e3b715fec11219bf9e1f57b2c67f1b7fa9 (diff) |
Prepend target name to object files.
Diffstat (limited to 'task_cc.cc')
-rw-r--r-- | task_cc.cc | 22 |
1 files changed, 17 insertions, 5 deletions
@@ -93,13 +93,25 @@ TaskCC::TaskCC(const BuildConfiguration& config, const Settings& settings, sourceFile = sourceDir; sourceFile /= source; - targetFile = settings.builddir / sourceFile.stem(); - targetFile += ".o"; + std::filesystem::path base = settings.builddir; + base /= config.target; + base += "-"; + base += sourceFile.stem(); - depsFile = settings.builddir / sourceFile.stem(); - depsFile += ".d"; + if(sourceFile.extension().string() == ".c") + { + base += "_c"; + } + else + { + base += "_cc"; + } - flagsFile = settings.builddir / sourceFile.stem(); + targetFile = base; + targetFile += ".o"; + depsFile = base; + depsFile += ".d"; + flagsFile = base; flagsFile += ".flags"; target_type = TargetType::Object; |