6666def CalculateVariables (default_variables , params ):
6767 """Calculate additional variables for use in the build (called by gyp)."""
6868 flavor = gyp .common .GetFlavor (params )
69- if flavor == "mac" :
70- default_variables .setdefault ("OS" , "mac" )
69+ if flavor in ( "mac" , "ios" ) :
70+ default_variables .setdefault ("OS" , flavor )
7171 default_variables .setdefault ("SHARED_LIB_SUFFIX" , ".dylib" )
7272 default_variables .setdefault (
7373 "SHARED_LIB_DIR" , generator_default_variables ["PRODUCT_DIR" ]
@@ -852,7 +852,7 @@ def Write(
852852 self .toolset = spec ["toolset" ]
853853
854854 self .is_mac_bundle = gyp .xcode_emulation .IsMacBundle (self .flavor , spec )
855- if self .flavor == "mac" :
855+ if self .flavor in ( "mac" , "ios" ) :
856856 self .xcode_settings = gyp .xcode_emulation .XcodeSettings (spec )
857857 else :
858858 self .xcode_settings = None
@@ -1047,7 +1047,7 @@ def WriteActions(
10471047
10481048 # Write the actual command.
10491049 action_commands = action ["action" ]
1050- if self .flavor == "mac" :
1050+ if self .flavor in ( "mac" , "ios" ) :
10511051 action_commands = [
10521052 gyp .xcode_emulation .ExpandEnvVars (command , env )
10531053 for command in action_commands
@@ -1231,7 +1231,7 @@ def WriteRules(
12311231 # action, cd_action, and mkdirs get written to a toplevel variable
12321232 # called cmd_foo. Toplevel variables can't handle things that change
12331233 # per makefile like $(TARGET), so hardcode the target.
1234- if self .flavor == "mac" :
1234+ if self .flavor in ( "mac" , "ios" ) :
12351235 action = [
12361236 gyp .xcode_emulation .ExpandEnvVars (command , env )
12371237 for command in action
@@ -1404,7 +1404,7 @@ def WriteSources(
14041404 quoter = EscapeCppDefine ,
14051405 )
14061406
1407- if self .flavor == "mac" :
1407+ if self .flavor in ( "mac" , "ios" ) :
14081408 cflags = self .xcode_settings .GetCflags (
14091409 configname , arch = config .get ("xcode_configuration_platform" )
14101410 )
@@ -1423,7 +1423,7 @@ def WriteSources(
14231423 self .WriteList (cflags_c , "CFLAGS_C_%s" % configname )
14241424 self .WriteLn ("# Flags passed to only C++ files." )
14251425 self .WriteList (cflags_cc , "CFLAGS_CC_%s" % configname )
1426- if self .flavor == "mac" :
1426+ if self .flavor in ( "mac" , "ios" ) :
14271427 self .WriteLn ("# Flags passed to only ObjC files." )
14281428 self .WriteList (cflags_objc , "CFLAGS_OBJC_%s" % configname )
14291429 self .WriteLn ("# Flags passed to only ObjC++ files." )
@@ -1493,7 +1493,7 @@ def WriteSources(
14931493 "%s " % precompiled_header .GetInclude ("cc" ) + "$(CFLAGS_$(BUILDTYPE)) "
14941494 "$(CFLAGS_CC_$(BUILDTYPE))"
14951495 )
1496- if self .flavor == "mac" :
1496+ if self .flavor in ( "mac" , "ios" ) :
14971497 self .WriteLn (
14981498 "$(OBJS): GYP_OBJCFLAGS := "
14991499 "$(DEFS_$(BUILDTYPE)) "
@@ -1560,7 +1560,7 @@ def ComputeOutputBasename(self, spec):
15601560 """
15611561 assert not self .is_mac_bundle
15621562
1563- if self .flavor == "mac" and self .type in (
1563+ if self .flavor in ( "mac" , "ios" ) and self .type in (
15641564 "static_library" ,
15651565 "executable" ,
15661566 "shared_library" ,
@@ -1607,7 +1607,7 @@ def ComputeOutputBasename(self, spec):
16071607 def _InstallImmediately (self ):
16081608 return (
16091609 self .toolset == "target"
1610- and self .flavor == "mac"
1610+ and self .flavor in ( "mac" , "ios" )
16111611 and self .type
16121612 in ("static_library" , "executable" , "shared_library" , "loadable_module" )
16131613 )
@@ -1705,7 +1705,7 @@ def WriteTarget(
17051705 if self .type != "none" :
17061706 for configname in sorted (configs .keys ()):
17071707 config = configs [configname ]
1708- if self .flavor == "mac" :
1708+ if self .flavor in ( "mac" , "ios" ) :
17091709 ldflags = self .xcode_settings .GetLdflags (
17101710 configname ,
17111711 generator_default_variables ["PRODUCT_DIR" ],
@@ -1740,7 +1740,7 @@ def WriteTarget(
17401740 library_dirs = [Sourceify (self .Absolutify (i )) for i in library_dirs ]
17411741 ldflags += [("-L%s" % library_dir ) for library_dir in library_dirs ]
17421742 self .WriteList (ldflags , "LDFLAGS_%s" % configname )
1743- if self .flavor == "mac" :
1743+ if self .flavor in ( "mac" , "ios" ) :
17441744 self .WriteList (
17451745 self .xcode_settings .GetLibtoolflags (configname ),
17461746 "LIBTOOLFLAGS_%s" % configname ,
@@ -1749,7 +1749,7 @@ def WriteTarget(
17491749 if libraries :
17501750 # Remove duplicate entries
17511751 libraries = gyp .common .uniquer (libraries )
1752- if self .flavor == "mac" :
1752+ if self .flavor in ( "mac" , "ios" ) :
17531753 libraries = self .xcode_settings .AdjustLibraries (libraries )
17541754 self .WriteList (libraries , "LIBS" )
17551755 self .WriteLn (
@@ -1758,7 +1758,7 @@ def WriteTarget(
17581758 )
17591759 self .WriteLn ("%s: LIBS := $(LIBS)" % QuoteSpaces (self .output_binary ))
17601760
1761- if self .flavor == "mac" :
1761+ if self .flavor in ( "mac" , "ios" ) :
17621762 self .WriteLn (
17631763 "%s: GYP_LIBTOOLFLAGS := $(LIBTOOLFLAGS_$(BUILDTYPE))"
17641764 % QuoteSpaces (self .output_binary )
@@ -1767,7 +1767,7 @@ def WriteTarget(
17671767 # Postbuild actions. Like actions, but implicitly depend on the target's
17681768 # output.
17691769 postbuilds = []
1770- if self .flavor == "mac" :
1770+ if self .flavor in ( "mac" , "ios" ) :
17711771 if target_postbuilds :
17721772 postbuilds .append ("$(TARGET_POSTBUILDS_$(BUILDTYPE))" )
17731773 postbuilds .extend (gyp .xcode_emulation .GetSpecPostbuildCommands (spec ))
@@ -1877,7 +1877,7 @@ def WriteTarget(
18771877 "Spaces in alink input filenames not supported (%s)" % link_dep
18781878 )
18791879 if (
1880- self .flavor not in ("mac" , "openbsd" , "netbsd" , "win" )
1880+ self .flavor not in ("mac" , "ios" , " openbsd" , "netbsd" , "win" )
18811881 and not self .is_standalone_static_library
18821882 ):
18831883 if self .flavor in ("linux" , "android" ):
@@ -1995,7 +1995,7 @@ def WriteTarget(
19951995 if self .flavor != "zos" :
19961996 installable_deps .append (self .output )
19971997 if (
1998- self .flavor == "mac"
1998+ self .flavor in ( "mac" , "ios" )
19991999 and "product_dir" not in spec
20002000 and self .toolset == "target"
20012001 ):
@@ -2495,7 +2495,7 @@ def CalculateMakefilePath(build_file, base_name):
24952495 "LINK.host" : LINK_host ,
24962496 "PLI.host" : PLI_host ,
24972497 }
2498- if flavor == "mac" :
2498+ if flavor in ( "mac" , "ios" ) :
24992499 flock_command = "%s gyp-mac-tool flock" % sys .executable
25002500 header_params .update (
25012501 {
@@ -2673,7 +2673,7 @@ def CalculateMakefilePath(build_file, base_name):
26732673 spec = target_dicts [qualified_target ]
26742674 configs = spec ["configurations" ]
26752675
2676- if flavor == "mac" :
2676+ if flavor in ( "mac" , "ios" ) :
26772677 gyp .xcode_emulation .MergeGlobalXcodeSettingsToSpec (data [build_file ], spec )
26782678
26792679 writer = MakefileWriter (generator_flags , flavor )
0 commit comments