Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: pylib/gyp/generator/ninja.py

Issue 602073003: Add support for MIDL include directories (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 # Copyright (c) 2013 Google Inc. All rights reserved. 1 # Copyright (c) 2013 Google Inc. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 import copy 6 import copy
7 import hashlib 7 import hashlib
8 import json 8 import json
9 import multiprocessing 9 import multiprocessing
10 import os.path 10 import os.path
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 include_dirs = config.get('include_dirs', []) 877 include_dirs = config.get('include_dirs', [])
878 878
879 env = self.GetToolchainEnv() 879 env = self.GetToolchainEnv()
880 if self.flavor == 'win': 880 if self.flavor == 'win':
881 include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs, 881 include_dirs = self.msvs_settings.AdjustIncludeDirs(include_dirs,
882 config_name) 882 config_name)
883 self.WriteVariableList(ninja_file, 'includes', 883 self.WriteVariableList(ninja_file, 'includes',
884 [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor) 884 [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
885 for i in include_dirs]) 885 for i in include_dirs])
886 886
887 if self.flavor == 'win':
888 midl_include_dirs = config.get('midl_include_dirs', [])
889 midl_include_dirs = self.msvs_settings.AdjustMidlIncludeDirs(
890 midl_include_dirs, config_name)
891 self.WriteVariableList(ninja_file, 'midl_includes',
892 [QuoteShellArgument('-I' + self.GypPathToNinja(i, env), self.flavor)
893 for i in midl_include_dirs])
894
887 pch_commands = precompiled_header.GetPchBuildCommands(arch) 895 pch_commands = precompiled_header.GetPchBuildCommands(arch)
888 if self.flavor == 'mac': 896 if self.flavor == 'mac':
889 # Most targets use no precompiled headers, so only write these if needed. 897 # Most targets use no precompiled headers, so only write these if needed.
890 for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'), 898 for ext, var in [('c', 'cflags_pch_c'), ('cc', 'cflags_pch_cc'),
891 ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]: 899 ('m', 'cflags_pch_objc'), ('mm', 'cflags_pch_objcc')]:
892 include = precompiled_header.GetInclude(ext, arch) 900 include = precompiled_header.GetInclude(ext, arch)
893 if include: ninja_file.variable(var, include) 901 if include: ninja_file.variable(var, include)
894 902
895 self.WriteVariableList(ninja_file, 'cflags', 903 self.WriteVariableList(ninja_file, 'cflags',
896 map(self.ExpandSpecial, cflags)) 904 map(self.ExpandSpecial, cflags))
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
1923 description='CXX $out', 1931 description='CXX $out',
1924 command=cxx_command, 1932 command=cxx_command,
1925 rspfile='$out.rsp', 1933 rspfile='$out.rsp',
1926 rspfile_content='$defines $includes $cflags $cflags_cc', 1934 rspfile_content='$defines $includes $cflags $cflags_cc',
1927 deps=deps) 1935 deps=deps)
1928 master_ninja.rule( 1936 master_ninja.rule(
1929 'idl', 1937 'idl',
1930 description='IDL $in', 1938 description='IDL $in',
1931 command=('%s gyp-win-tool midl-wrapper $arch $outdir ' 1939 command=('%s gyp-win-tool midl-wrapper $arch $outdir '
1932 '$tlb $h $dlldata $iid $proxy $in ' 1940 '$tlb $h $dlldata $iid $proxy $in '
1933 '$idlflags' % sys.executable)) 1941 '$midl_includes $idlflags' % sys.executable))
1934 master_ninja.rule( 1942 master_ninja.rule(
1935 'rc', 1943 'rc',
1936 description='RC $in', 1944 description='RC $in',
1937 # Note: $in must be last otherwise rc.exe complains. 1945 # Note: $in must be last otherwise rc.exe complains.
1938 command=('%s gyp-win-tool rc-wrapper ' 1946 command=('%s gyp-win-tool rc-wrapper '
1939 '$arch $rc $defines $resource_includes $rcflags /fo$out $in' % 1947 '$arch $rc $defines $resource_includes $rcflags /fo$out $in' %
1940 sys.executable)) 1948 sys.executable))
1941 master_ninja.rule( 1949 master_ninja.rule(
1942 'asm', 1950 'asm',
1943 description='ASM $out', 1951 description='ASM $out',
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
2276 arglists.append( 2284 arglists.append(
2277 (target_list, target_dicts, data, params, config_name)) 2285 (target_list, target_dicts, data, params, config_name))
2278 pool.map(CallGenerateOutputForConfig, arglists) 2286 pool.map(CallGenerateOutputForConfig, arglists)
2279 except KeyboardInterrupt, e: 2287 except KeyboardInterrupt, e:
2280 pool.terminate() 2288 pool.terminate()
2281 raise e 2289 raise e
2282 else: 2290 else:
2283 for config_name in config_names: 2291 for config_name in config_names:
2284 GenerateOutputForConfig(target_list, target_dicts, data, params, 2292 GenerateOutputForConfig(target_list, target_dicts, data, params,
2285 config_name) 2293 config_name)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698