aboutsummaryrefslogtreecommitdiff
path: root/environment.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-06-15 02:10:47 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-06-15 02:10:47 +0300
commite967e5eb4bf2a46bb0d7f920fd4e8ffaa6f970fe (patch)
tree7c0ea51055f1997965b7bc4be27202e9b85097ab /environment.py
parentcbd4f58302825a64435a5af70de52439b0fba601 (diff)
downloadmeson-e967e5eb4bf2a46bb0d7f920fd4e8ffaa6f970fe.zip
meson-e967e5eb4bf2a46bb0d7f920fd4e8ffaa6f970fe.tar.gz
meson-e967e5eb4bf2a46bb0d7f920fd4e8ffaa6f970fe.tar.bz2
At last! MSVC precompiles headers and can use them.
Diffstat (limited to 'environment.py')
-rwxr-xr-xenvironment.py19
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']