OLD | NEW |
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 1699 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1710 gyp.common.CopyTool(flavor, toplevel_build) | 1710 gyp.common.CopyTool(flavor, toplevel_build) |
1711 | 1711 |
1712 # Grab make settings for CC/CXX. | 1712 # Grab make settings for CC/CXX. |
1713 # The rules are | 1713 # The rules are |
1714 # - The priority from low to high is gcc/g++, the 'make_global_settings' in | 1714 # - The priority from low to high is gcc/g++, the 'make_global_settings' in |
1715 # gyp, the environment variable. | 1715 # gyp, the environment variable. |
1716 # - If there is no 'make_global_settings' for CC.host/CXX.host or | 1716 # - If there is no 'make_global_settings' for CC.host/CXX.host or |
1717 # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set | 1717 # 'CC_host'/'CXX_host' enviroment variable, cc_host/cxx_host should be set |
1718 # to cc/cxx. | 1718 # to cc/cxx. |
1719 if flavor == 'win': | 1719 if flavor == 'win': |
| 1720 ar = 'lib.exe' |
1720 # cc and cxx must be set to the correct architecture by overriding with one | 1721 # cc and cxx must be set to the correct architecture by overriding with one |
1721 # of cl_x86 or cl_x64 below. | 1722 # of cl_x86 or cl_x64 below. |
1722 cc = 'UNSET' | 1723 cc = 'UNSET' |
1723 cxx = 'UNSET' | 1724 cxx = 'UNSET' |
1724 ld = 'link.exe' | 1725 ld = 'link.exe' |
1725 ld_host = '$ld' | 1726 ld_host = '$ld' |
1726 else: | 1727 else: |
| 1728 ar = 'ar' |
1727 cc = 'cc' | 1729 cc = 'cc' |
1728 cxx = 'c++' | 1730 cxx = 'c++' |
1729 ld = '$cc' | 1731 ld = '$cc' |
1730 ldxx = '$cxx' | 1732 ldxx = '$cxx' |
1731 ld_host = '$cc_host' | 1733 ld_host = '$cc_host' |
1732 ldxx_host = '$cxx_host' | 1734 ldxx_host = '$cxx_host' |
1733 | 1735 |
1734 cc_host = None | 1736 cc_host = None |
1735 cxx_host = None | 1737 cxx_host = None |
1736 cc_host_global_setting = None | 1738 cc_host_global_setting = None |
1737 cxx_host_global_setting = None | 1739 cxx_host_global_setting = None |
1738 clang_cl = None | 1740 clang_cl = None |
1739 | 1741 |
1740 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) | 1742 build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) |
1741 make_global_settings = data[build_file].get('make_global_settings', []) | 1743 make_global_settings = data[build_file].get('make_global_settings', []) |
1742 build_to_root = gyp.common.InvertRelativePath(build_dir, | 1744 build_to_root = gyp.common.InvertRelativePath(build_dir, |
1743 options.toplevel_dir) | 1745 options.toplevel_dir) |
1744 wrappers = {} | 1746 wrappers = {} |
1745 for key, value in make_global_settings: | 1747 for key, value in make_global_settings: |
| 1748 if key == 'AR': |
| 1749 ar = os.path.join(build_to_root, value) |
1746 if key == 'CC': | 1750 if key == 'CC': |
1747 cc = os.path.join(build_to_root, value) | 1751 cc = os.path.join(build_to_root, value) |
1748 if cc.endswith('clang-cl'): | 1752 if cc.endswith('clang-cl'): |
1749 clang_cl = cc | 1753 clang_cl = cc |
1750 if key == 'CXX': | 1754 if key == 'CXX': |
1751 cxx = os.path.join(build_to_root, value) | 1755 cxx = os.path.join(build_to_root, value) |
1752 if key == 'CC.host': | 1756 if key == 'CC.host': |
1753 cc_host = os.path.join(build_to_root, value) | 1757 cc_host = os.path.join(build_to_root, value) |
1754 cc_host_global_setting = value | 1758 cc_host_global_setting = value |
1755 if key == 'CXX.host': | 1759 if key == 'CXX.host': |
(...skipping 24 matching lines...) Expand all Loading... |
1780 master_ninja.variable('cl_' + arch, command) | 1784 master_ninja.variable('cl_' + arch, command) |
1781 | 1785 |
1782 cc = GetEnvironFallback(['CC_target', 'CC'], cc) | 1786 cc = GetEnvironFallback(['CC_target', 'CC'], cc) |
1783 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) | 1787 master_ninja.variable('cc', CommandWithWrapper('CC', wrappers, cc)) |
1784 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) | 1788 cxx = GetEnvironFallback(['CXX_target', 'CXX'], cxx) |
1785 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) | 1789 master_ninja.variable('cxx', CommandWithWrapper('CXX', wrappers, cxx)) |
1786 | 1790 |
1787 if flavor == 'win': | 1791 if flavor == 'win': |
1788 master_ninja.variable('ld', ld) | 1792 master_ninja.variable('ld', ld) |
1789 master_ninja.variable('idl', 'midl.exe') | 1793 master_ninja.variable('idl', 'midl.exe') |
1790 master_ninja.variable('ar', 'lib.exe') | 1794 master_ninja.variable('ar', ar) |
1791 master_ninja.variable('rc', 'rc.exe') | 1795 master_ninja.variable('rc', 'rc.exe') |
1792 master_ninja.variable('asm', 'ml.exe') | 1796 master_ninja.variable('asm', 'ml.exe') |
1793 master_ninja.variable('mt', 'mt.exe') | 1797 master_ninja.variable('mt', 'mt.exe') |
1794 else: | 1798 else: |
1795 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) | 1799 master_ninja.variable('ld', CommandWithWrapper('LINK', wrappers, ld)) |
1796 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) | 1800 master_ninja.variable('ldxx', CommandWithWrapper('LINK', wrappers, ldxx)) |
1797 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], 'ar')) | 1801 master_ninja.variable('ar', GetEnvironFallback(['AR_target', 'AR'], ar)) |
1798 | 1802 |
1799 if generator_supports_multiple_toolsets: | 1803 if generator_supports_multiple_toolsets: |
1800 if not cc_host: | 1804 if not cc_host: |
1801 cc_host = cc | 1805 cc_host = cc |
1802 if not cxx_host: | 1806 if not cxx_host: |
1803 cxx_host = cxx | 1807 cxx_host = cxx |
1804 | 1808 |
1805 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar')) | 1809 master_ninja.variable('ar_host', GetEnvironFallback(['AR_host'], 'ar')) |
1806 cc_host = GetEnvironFallback(['CC_host'], cc_host) | 1810 cc_host = GetEnvironFallback(['CC_host'], cc_host) |
1807 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) | 1811 cxx_host = GetEnvironFallback(['CXX_host'], cxx_host) |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2209 arglists.append( | 2213 arglists.append( |
2210 (target_list, target_dicts, data, params, config_name)) | 2214 (target_list, target_dicts, data, params, config_name)) |
2211 pool.map(CallGenerateOutputForConfig, arglists) | 2215 pool.map(CallGenerateOutputForConfig, arglists) |
2212 except KeyboardInterrupt, e: | 2216 except KeyboardInterrupt, e: |
2213 pool.terminate() | 2217 pool.terminate() |
2214 raise e | 2218 raise e |
2215 else: | 2219 else: |
2216 for config_name in config_names: | 2220 for config_name in config_names: |
2217 GenerateOutputForConfig(target_list, target_dicts, data, params, | 2221 GenerateOutputForConfig(target_list, target_dicts, data, params, |
2218 config_name) | 2222 config_name) |
OLD | NEW |