Пример #1
0
        /// <summary>
        /// Checks if platform is part of a given platform group
        /// </summary>
        /// <param name="Platform">The platform to check</param>
        /// <param name="PlatformGroup">The platform group to check</param>
        /// <returns>True if platform is part of a platform group</returns>
        internal static bool IsPlatformInGroup(UnrealTargetPlatform Platform, UnrealPlatformGroup PlatformGroup)
        {
            List <UnrealTargetPlatform> Platforms = UEBuildPlatform.GetPlatformsInGroup(PlatformGroup);

            if (Platforms != null)
            {
                return(Platforms.Contains(Platform));
            }
            else
            {
                return(false);
            }
        }
Пример #2
0
        /// <summary>
        /// Given a list of supported platforms, returns a list of names of platforms that should not be supported
        /// </summary>
        /// <param name="SupportedPlatforms">List of supported platforms</param>
        /// <returns>List of unsupported platforms in string format</returns>
        public static List <string> MakeListOfUnsupportedPlatforms(List <UnrealTargetPlatform> SupportedPlatforms)
        {
            // Make a list of all platform name strings that we're *not* currently compiling, to speed
            // up file path comparisons later on
            List <string> OtherPlatformNameStrings = new List <string>();
            {
                // look at each group to see if any supported platforms are in it
                List <UnrealPlatformGroup> SupportedGroups = new List <UnrealPlatformGroup>();
                foreach (UnrealPlatformGroup Group in Enum.GetValues(typeof(UnrealPlatformGroup)))
                {
                    // get the list of platforms registered to this group, if any
                    List <UnrealTargetPlatform> Platforms = UEBuildPlatform.GetPlatformsInGroup(Group);
                    if (Platforms != null)
                    {
                        // loop over each one
                        foreach (UnrealTargetPlatform Platform in Platforms)
                        {
                            // if it's a compiled platform, then add this group to be supported
                            if (SupportedPlatforms.Contains(Platform))
                            {
                                SupportedGroups.Add(Group);
                            }
                        }
                    }
                }

                // loop over groups one more time, anything NOT in SupportedGroups is now unsuppored, and should be added to the output list
                foreach (UnrealPlatformGroup Group in Enum.GetValues(typeof(UnrealPlatformGroup)))
                {
                    if (SupportedGroups.Contains(Group) == false)
                    {
                        OtherPlatformNameStrings.Add(Group.ToString());
                    }
                }

                foreach (UnrealTargetPlatform CurPlatform in Enum.GetValues(typeof(UnrealTargetPlatform)))
                {
                    if (CurPlatform != UnrealTargetPlatform.Unknown)
                    {
                        bool ShouldConsider = true;

                        // If we have a platform and a group with the same name, don't add the platform
                        // to the other list if the same-named group is supported.  This is a lot of
                        // lines because we need to do the comparisons as strings.
                        string CurPlatformString = CurPlatform.ToString();
                        foreach (UnrealPlatformGroup Group in Enum.GetValues(typeof(UnrealPlatformGroup)))
                        {
                            if (Group.ToString().Equals(CurPlatformString))
                            {
                                ShouldConsider = false;
                                break;
                            }
                        }

                        // Don't add our current platform to the list of platform sub-directory names that
                        // we'll skip source files for
                        if (ShouldConsider && !SupportedPlatforms.Contains(CurPlatform))
                        {
                            OtherPlatformNameStrings.Add(CurPlatform.ToString());
                        }
                    }
                }

                return(OtherPlatformNameStrings);
            }
        }