From e967e5eb4bf2a46bb0d7f920fd4e8ffaa6f970fe Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sat, 15 Jun 2013 02:10:47 +0300 Subject: At last! MSVC precompiles headers and can use them. --- environment.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'environment.py') diff --git a/environment.py b/environment.py index 9274651e3..376ebfa0b 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'] -- cgit v1.2.3