@@ -579,7 +579,8 @@ def GetCflags(self, configname, arch=None):
579579
580580 sdk_root = self ._SdkPath ()
581581 if "SDKROOT" in self ._Settings () and sdk_root :
582- cflags .append ("-isysroot %s" % sdk_root )
582+ cflags .append ("-isysroot" )
583+ cflags .append (sdk_root )
583584
584585 if self .header_map_path :
585586 cflags .append ("-I%s" % self .header_map_path )
@@ -664,7 +665,8 @@ def GetCflags(self, configname, arch=None):
664665 # TODO: Supporting fat binaries will be annoying.
665666 self ._WarnUnimplemented ("ARCHS" )
666667 archs = ["i386" ]
667- cflags .append ("-arch " + archs [0 ])
668+ cflags .append ("-arch" )
669+ cflags .append (archs [0 ])
668670
669671 if archs [0 ] in ("i386" , "x86_64" ):
670672 if self ._Test ("GCC_ENABLE_SSE3_EXTENSIONS" , "YES" , default = "NO" ):
@@ -924,17 +926,15 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
924926 self ._AppendPlatformVersionMinFlags (ldflags )
925927
926928 if "SDKROOT" in self ._Settings () and self ._SdkPath ():
927- ldflags .append ("-isysroot " + self ._SdkPath ())
929+ ldflags .append ("-isysroot" )
930+ ldflags .append (self ._SdkPath ())
928931
929932 for library_path in self ._Settings ().get ("LIBRARY_SEARCH_PATHS" , []):
930933 ldflags .append ("-L" + gyp_to_build_path (library_path ))
931934
932935 if "ORDER_FILE" in self ._Settings ():
933- ldflags .append (
934- "-Wl,-order_file "
935- + "-Wl,"
936- + gyp_to_build_path (self ._Settings ()["ORDER_FILE" ])
937- )
936+ ldflags .append ("-Wl,-order_file" )
937+ ldflags .append ("-Wl," + gyp_to_build_path (self ._Settings ()["ORDER_FILE" ]))
938938
939939 if not gyp .common .CrossCompileRequested ():
940940 if arch is not None :
@@ -946,15 +946,18 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
946946 # TODO: Supporting fat binaries will be annoying.
947947 self ._WarnUnimplemented ("ARCHS" )
948948 archs = ["i386" ]
949- ldflags .append ("-arch " + archs [0 ])
949+ # Avoid quoting the space between -arch and the arch name
950+ ldflags .append ("-arch" )
951+ ldflags .append (archs [0 ])
950952
951953 # Xcode adds the product directory by default.
952954 # Rewrite -L. to -L./ to work around http://www.openradar.me/25313838
953955 ldflags .append ("-L" + (product_dir if product_dir != "." else "./" ))
954956
955957 install_name = self .GetInstallName ()
956958 if install_name and self .spec ["type" ] != "loadable_module" :
957- ldflags .append ("-install_name " + install_name .replace (" " , r"\ " ))
959+ ldflags .append ("-install_name" )
960+ ldflags .append (install_name .replace (" " , r"\ " ))
958961
959962 for rpath in self ._Settings ().get ("LD_RUNPATH_SEARCH_PATHS" , []):
960963 ldflags .append ("-Wl,-rpath," + rpath )
@@ -971,7 +974,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
971974 platform_root = self ._XcodePlatformPath (configname )
972975 if sdk_root and platform_root :
973976 ldflags .append ("-F" + platform_root + "/Developer/Library/Frameworks/" )
974- ldflags .append ("-framework XCTest" )
977+ ldflags .append ("-framework" )
978+ ldflags .append ("XCTest" )
975979
976980 is_extension = self ._IsIosAppExtension () or self ._IsIosWatchKitExtension ()
977981 if sdk_root and is_extension :
@@ -987,7 +991,8 @@ def GetLdflags(self, configname, product_dir, gyp_to_build_path, arch=None):
987991 + "/System/Library/PrivateFrameworks/PlugInKit.framework/PlugInKit"
988992 )
989993 else :
990- ldflags .append ("-e _NSExtensionMain" )
994+ ldflags .append ("-e" )
995+ ldflags .append ("_NSExtensionMain" )
991996 ldflags .append ("-fapplication-extension" )
992997
993998 self ._Appendf (ldflags , "CLANG_CXX_LIBRARY" , "-stdlib=%s" )
0 commit comments