@@ -921,6 +921,11 @@ def WriteSourcesForArch(self, ninja_file, config_name, config, sources,
921921 os .environ .get ('CFLAGS' , '' ).split () + cflags_c )
922922 cflags_cc = (os .environ .get ('CPPFLAGS' , '' ).split () +
923923 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 )
924929
925930 defines = config .get ('defines' , []) + extra_defines
926931 self .WriteVariableList (ninja_file , 'defines' ,
@@ -1672,7 +1677,7 @@ def CommandWithWrapper(cmd, wrappers, prog):
16721677
16731678def GetDefaultConcurrentLinks ():
16741679 """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 ))
16761681 if pool_size :
16771682 return pool_size
16781683
@@ -1696,8 +1701,10 @@ class MEMORYSTATUSEX(ctypes.Structure):
16961701 stat .dwLength = ctypes .sizeof (stat )
16971702 ctypes .windll .kernel32 .GlobalMemoryStatusEx (ctypes .byref (stat ))
16981703
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 )))
17011708 return min (mem_limit , hard_cap )
17021709 elif sys .platform .startswith ('linux' ):
17031710 if os .path .exists ("/proc/meminfo" ):
@@ -2275,7 +2282,11 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params,
22752282 if flavor == 'mac' :
22762283 gyp .xcode_emulation .MergeGlobalXcodeSettingsToSpec (data [build_file ], spec )
22772284
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 )
22792290
22802291 qualified_target_for_hash = gyp .common .QualifiedTarget (build_file , name ,
22812292 toolset )
0 commit comments