diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-15 00:37:14 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2013-06-15 00:37:14 +0300 |
commit | a1f4bf1124588fd59f8eed95f13ec445b236735b (patch) | |
tree | 7e9b5cc8ba5879f3c5a25cd717474ac8e64b69fd /environment.py | |
parent | 81b478e03108d341f1021bfe7db18e21a758a9fc (diff) | |
download | meson-a1f4bf1124588fd59f8eed95f13ec445b236735b.zip meson-a1f4bf1124588fd59f8eed95f13ec445b236735b.tar.gz meson-a1f4bf1124588fd59f8eed95f13ec445b236735b.tar.bz2 |
Started work on MSVC precompiled headers. It does not work yet but I have been at it for so long that I want to just commit now because it at least does something close to the final result.
Diffstat (limited to 'environment.py')
-rwxr-xr-x | environment.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/environment.py b/environment.py index 0212dbd..9274651 100755 --- a/environment.py +++ b/environment.py @@ -169,8 +169,6 @@ int main(int argc, char **argv) { raise EnvironmentException('Could not run sizeof test binary.') return int(so.decode()) -cpp_suffixes = ['cc', 'cpp', 'cxx', 'hh', 'hpp', 'hxx'] - class CPPCompiler(CCompiler): def __init__(self, exelist): CCompiler.__init__(self, exelist) @@ -280,6 +278,9 @@ class VisualStudioCCompiler(CCompiler): def get_std_shared_lib_link_flags(self): return ['/DLL'] + def gen_pch_args(self, header, source, pchname): + return ['/Yc' + header, '/Fp' + pchname] + def sanity_check(self, work_dir): source_name = os.path.join(work_dir, 'sanitycheckc.c') binary_name = os.path.join(work_dir, 'sanitycheckc') @@ -504,6 +505,17 @@ def is_windows(): return platform.system().lower() == 'windows' header_suffixes = ['h', 'hh', 'hpp', 'hxx', 'H'] +cpp_suffixes = ['cc', 'cpp', 'cxx', 'hh', 'hpp', 'hxx'] +c_suffixes = ['c'] +clike_suffixes = c_suffixes + cpp_suffixes + +def is_header(fname): + suffix = fname.split('.')[-1] + return suffix in header_suffixes + +def is_source(fname): + suffix = fname.split('.')[-1] + return suffix in clike_suffixes class Environment(): private_dir = 'meson-private' @@ -573,8 +585,10 @@ class Environment(): return self.meson_script_file def is_header(self, fname): - suffix = fname.split('.')[-1] - return suffix in header_suffixes + return is_header(fname) + + def is_source(self, fname): + return is_source(fname) def detect_c_compiler(self): evar = 'CC' |