public override string PrepareForBuild(BuildOptions options, BuildTarget target) { var namedBuildTarget = NamedBuildTarget.FromActiveSettings(target); var isServer = namedBuildTarget == NamedBuildTarget.Server; switch (PlayerSettings.GetScriptingBackend(namedBuildTarget)) { case ScriptingImplementation.Mono2x: if ((!isServer && !m_HasMonoPlayers) || (isServer && !m_HasServerMonoPlayers)) { return("Currently selected scripting backend (Mono) is not installed."); } break; case ScriptingImplementation.IL2CPP: if ((!isServer && !m_HasIl2CppPlayers) || (isServer && !m_HasServerIl2CppPlayers)) { return("Currently selected scripting backend (IL2CPP) is not installed."); } break; #pragma warning disable 618 case ScriptingImplementation.CoreCLR: if ((!isServer && !m_HasCoreCLRPlayers) || (isServer && !m_HasServerCoreCLRPlayers)) { return("Currently selected scripting backend (CoreCLR) is not installed."); } break; default: return($"Unknown scripting backend: {PlayerSettings.GetScriptingBackend(namedBuildTarget)}"); } return(base.PrepareForBuild(options, target)); }
public BaseIl2CppPlatformProvider(BuildTarget target, string libraryFolder, BuildReport buildReport, string baselibLibraryDirectory) { this.target = target; this.namedBuildTarget = NamedBuildTarget.FromActiveSettings(target); this.libraryFolder = libraryFolder; this.buildReport = buildReport; _baselibLibraryDirectory = baselibLibraryDirectory; }
public static List <string> GetStaticSearchPaths(BuildTarget buildTarget) { var unityAssembliesInternal = EditorCompilationInterface.Instance.PrecompiledAssemblyProvider.GetUnityAssemblies(true, buildTarget); var namedBuildTarget = NamedBuildTarget.FromActiveSettings(buildTarget); var systemReferenceDirectories = MonoLibraryHelpers.GetSystemReferenceDirectories( PlayerSettings.GetApiCompatibilityLevel(namedBuildTarget)); var searchPaths = unityAssembliesInternal.Select(x => Path.GetDirectoryName(x.Path)) .Distinct().ToList(); searchPaths.AddRange(systemReferenceDirectories); return(searchPaths); }
public UnityLinkerRunInformation(string managedAssemblyFolderPath, BaseUnityLinkerPlatformProvider platformProvider, BuildTarget buildTarget, RuntimeClassRegistry rcr, ManagedStrippingLevel managedStrippingLevel, IIl2CppPlatformProvider il2CppPlatformProvider, BuildReport buildReport = null) { this.managedAssemblyFolderPath = managedAssemblyFolderPath; target = buildTarget; this.platformProvider = platformProvider; this.rcr = rcr; this.managedStrippingLevel = managedStrippingLevel; this.il2CppPlatformProvider = il2CppPlatformProvider; this.buildReport = buildReport; pipelineData = new UnityLinkerBuildPipelineData(target, managedAssemblyFolderPath); buildTargetGroup = BuildPipeline.GetBuildTargetGroup(buildTarget); namedBuildTarget = NamedBuildTarget.FromActiveSettings(buildTarget); argumentProvider = new UnityLinkerArgumentValueProvider(this); isMonoBackend = PlayerSettings.GetScriptingBackend(namedBuildTarget) == ScriptingImplementation.Mono2x; engineStrippingSupported = (platformProvider?.supportsEngineStripping ?? false) && !isMonoBackend; performEngineStripping = rcr != null && PlayerSettings.stripEngineCode && engineStrippingSupported; }
public override string PrepareForBuild(BuildOptions options, BuildTarget target) { var namedBuildTarget = NamedBuildTarget.FromActiveSettings(target); var isServer = namedBuildTarget == NamedBuildTarget.Server; if ((!isServer && !m_HasMonoPlayers) || (isServer && !m_HasServerMonoPlayers)) { if (PlayerSettings.GetScriptingBackend(namedBuildTarget) != ScriptingImplementation.IL2CPP) { return("Currently selected scripting backend (Mono) is not installed."); } } if ((!isServer && !m_HasIl2CppPlayers) || (isServer && !m_HasServerIl2CppPlayers)) { if (PlayerSettings.GetScriptingBackend(namedBuildTarget) == ScriptingImplementation.IL2CPP) { return("Currently selected scripting backend (IL2CPP) is not installed."); } } return(base.PrepareForBuild(options, target)); }
public override void UpdateBootConfig(BuildTarget target, BootConfigData config, BuildOptions options) { base.UpdateBootConfig(target, config, options); if (PlayerSettings.forceSingleInstance) { config.AddKey("single-instance"); } if (!PlayerSettings.useFlipModelSwapchain) { config.AddKey("force-d3d11-bitblt-mode"); } if (IL2CPPUtils.UseIl2CppCodegenWithMonoBackend(NamedBuildTarget.FromActiveSettings(target))) { config.Set("mono-codegen", "il2cpp"); } if ((options & BuildOptions.EnableCodeCoverage) != 0) { config.Set("enableCodeCoverage", "1"); } if (!PlayerSettings.usePlayerLog) { config.AddKey("nolog"); } }
internal static string[] GetCompilationDefines(EditorScriptCompilationOptions options, BuildTargetGroup targetGroup, BuildTarget target) { return(GetCompilationDefines(options, targetGroup, target, PlayerSettings.GetApiCompatibilityLevel(NamedBuildTarget.FromActiveSettings(target)))); }