diff options
Diffstat (limited to 'environment.py')
-rwxr-xr-x | environment.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/environment.py b/environment.py index 9274651..376ebfa 100755 --- a/environment.py +++ b/environment.py @@ -93,7 +93,13 @@ class CCompiler(): def name_string(self): return ' '.join(self.exelist) - + + def get_pch_use_args(self, pch_dir, header): + return ['-include', os.path.split(header)[-1]] + + def get_pch_name(self, header_name): + return os.path.split(header_name)[-1] + '.' + self.get_pch_suffix() + def sanity_check(self, work_dir): source_name = os.path.join(work_dir, 'sanitycheckc.c') binary_name = os.path.join(work_dir, 'sanitycheckc') @@ -251,6 +257,17 @@ class VisualStudioCCompiler(CCompiler): def get_pch_suffix(self): return 'pch' + + def get_pch_name(self, header): + chopped = os.path.split(header)[-1].split('.')[:-1] + chopped.append(self.get_pch_suffix()) + pchname = '.'.join(chopped) + return pchname + + def get_pch_use_args(self, pch_dir, header): + base = os.path.split(header)[-1] + pchname = self.get_pch_name(header) + return ['/FI' + base, '/Yu' + base, '/Fp' + os.path.join(pch_dir, pchname)] def get_debug_flags(self): return ['/D_DEBUG', '/Zi', '/MDd', '/Ob0', '/RTC1'] |