@@ -921,6 +921,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
921
921
os .environ .get ('CFLAGS' , '' ).split () + cflags_c )
922
922
cflags_cc = (os .environ .get ('CPPFLAGS' , '' ).split () +
923
923
os .environ .get ('CXXFLAGS' , '' ).split () + cflags_cc )
924
+ elif self .toolset == 'host' :
925
+ cflags_c = (os .environ .get ('CPPFLAGS_host' , '' ).split () +
926
+ os .environ .get ('CFLAGS_host' , '' ).split () + cflags_c )
927
+ cflags_cc = (os .environ .get ('CPPFLAGS_host' , '' ).split () +
928
+ os .environ .get ('CXXFLAGS_host' , '' ).split () + cflags_cc )
924
929
925
930
defines = config .get ('defines' , []) + extra_defines
926
931
self .WriteVariableList (ninja_file , 'defines' ,
@@ -1672,7 +1677,7 @@ def CommandWithWrapper(cmd, wrappers, prog):
1672
1677
1673
1678
def GetDefaultConcurrentLinks ():
1674
1679
"""Returns a best-guess for a number of concurrent links."""
1675
- pool_size = int (os .getenv ('GYP_LINK_CONCURRENCY' , 0 ))
1680
+ pool_size = int (os .environ . get ('GYP_LINK_CONCURRENCY' , 0 ))
1676
1681
if pool_size :
1677
1682
return pool_size
1678
1683
@@ -1696,8 +1701,10 @@ class MEMORYSTATUSEX(ctypes.Structure):
1696
1701
stat .dwLength = ctypes .sizeof (stat )
1697
1702
ctypes .windll .kernel32 .GlobalMemoryStatusEx (ctypes .byref (stat ))
1698
1703
1699
- mem_limit = max (1 , stat .ullTotalPhys / (4 * (2 ** 30 ))) # total / 4GB
1700
- hard_cap = max (1 , int (os .getenv ('GYP_LINK_CONCURRENCY_MAX' , 2 ** 32 )))
1704
+ # VS 2015 uses 20% more working set than VS 2013 and can consume all RAM
1705
+ # on a 64 GB machine.
1706
+ mem_limit = max (1 , stat .ullTotalPhys / (5 * (2 ** 30 ))) # total / 5GB
1707
+ hard_cap = max (1 , int (os .environ .get ('GYP_LINK_CONCURRENCY_MAX' , 2 ** 32 )))
1701
1708
return min (mem_limit , hard_cap )
1702
1709
elif sys .platform .startswith ('linux' ):
1703
1710
if os .path .exists ("/proc/meminfo" ):
@@ -2275,7 +2282,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
2275
2282
if flavor == 'mac' :
2276
2283
gyp .xcode_emulation .MergeGlobalXcodeSettingsToSpec (data [build_file ], spec )
2277
2284
2278
- build_file = gyp .common .RelativePath (build_file , options .toplevel_dir )
2285
+ # If build_file is a symlink, we must not follow it because there's a chance
2286
+ # it could point to a path above toplevel_dir, and we cannot correctly deal
2287
+ # with that case at the moment.
2288
+ build_file = gyp .common .RelativePath (build_file , options .toplevel_dir ,
2289
+ False )
2279
2290
2280
2291
qualified_target_for_hash = gyp .common .QualifiedTarget (build_file , name ,
2281
2292
toolset )
0 commit comments