From 65e49716857a78b6b593b5dad0375933f43f9f54 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 2 Apr 2014 21:03:21 +0300 Subject: [PATCH] Put targets in their subdirectories. --- backends.py | 6 +----- xcodebackend.py | 6 +++++- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backends.py b/backends.py index 10423311a..ff083eed0 100644 --- a/backends.py +++ b/backends.py @@ -107,7 +107,6 @@ class Backend(): self.interpreter = interp self.processed_targets = {} self.dep_rules = {} - self.output_path_override = None self.build_to_src = os.path.relpath(self.environment.get_source_dir(), self.environment.get_build_dir()) @@ -129,10 +128,7 @@ class Backend(): return filename def get_target_dir(self, target): - if self.output_path_override is None: - dirname = target.get_subdir() - else: - dirname = self.output_path_override + dirname = target.get_subdir() os.makedirs(os.path.join(self.environment.get_build_dir(), dirname), exist_ok=True) return dirname diff --git a/xcodebackend.py b/xcodebackend.py index 16a5b6d74..471d0618e 100644 --- a/xcodebackend.py +++ b/xcodebackend.py @@ -20,7 +20,6 @@ class XCodeBackend(backends.Backend): super().__init__(build, interp) self.project_uid = self.environment.coredata.guid.replace('-', '')[:24] self.project_conflist = self.gen_id() - self.output_path_override = self.environment.coredata.buildtype self.indent = ' ' self.indent_level = 0 self.xcodetypemap = {'c' : 'sourcecode.c.c', @@ -41,6 +40,11 @@ class XCodeBackend(backends.Backend): def gen_id(self): return str(uuid.uuid4()).upper().replace('-', '')[:24] + def get_target_dir(self, target): + dirname = os.path.join(target.get_subdir(), self.environment.coredata.buildtype) + os.makedirs(os.path.join(self.environment.get_build_dir(), dirname), exist_ok=True) + return dirname + def write_line(self, text): self.ofile.write(self.indent*self.indent_level + text) if not text.endswith('\n'):