string GetFlagForConfig(BuildConfig bc, string flag) { string output = ""; output += "SET(CMAKE_" + flag + "_FLAGS_" + bc.Name.ToUpper() + " "; if (bc.CurrentType == BuildConfiguration.BuildType.Debug) { output += "\"${CMAKE_" + flag + "_FLAGS_DEBUG}"; } else if (bc.CurrentType == BuildConfiguration.BuildType.Release) { output += "\"${CMAKE_" + flag + "_FLAGS_RELWITHDEBINFO}"; } foreach (string define in bc.Defines) { output += " /D" + define; } output += "\""; output += ") \n"; return(output); }
string AppendConfigFlags(BuildConfig bc, string flag, string value) { string configflagname = "CMAKE_" + flag + "_FLAGS_" + bc.Name.ToUpper(); return("SET(" + configflagname + " \"${" + configflagname + "} " + value + "\")\n"); }
string CreateLibs(ModuleDef m, BuildConfig BC, PlatformDefinition PD) { string linkout = ""; if (m.UnsupportedPlatforms.Contains(PD.Name)) { return(""); } string DllOut = ""; if (m != ModuleDefManager.CoreModule) { DllOut += "\"" + ModuleDefManager.CoreModule.ModuleName + "\", "; } List <LibRef> AllLibs = new List <LibRef>(); AllLibs.AddRange(m.ModuleLibs); if (m != ModuleDefManager.CoreModule) { LibRef r = new LibRef(); r.TargetPlatform = PlatformID.Invalid; string OutputDir = StringUtils.SanitizePath(ModuleDefManager.GetBinPath()) + "/" + PD.Name + "/" + BC.Name; r.Path = OutputDir + "/Core.lib"; AllLibs.Add(r); AllLibs.AddRange(ModuleDefManager.CoreModule.ModuleLibs); } //new core List <LibDependency> StaticLibs = new List <LibDependency>(); StaticLibs.AddRange(m.StaticLibraries); foreach (ExternalModuleDef ExtraMods in m.ExternalModules) { // if (!ExtraMods.UnsupportedPlatformsTypes.Contains("")) { StaticLibs.AddRange(ExtraMods.StaticLibraries); } } foreach (LibDependency dep in StaticLibs) { if (dep.Platforms.Contains(PD.TypeId)) { DllOut += "\"" + dep.LibName + "\", "; } } foreach (LibRef r in AllLibs) { if (r.TargetPlatform != PlatformID.Invalid && r.TargetPlatform != PD.TypeId) { continue; } if (r.BuildCFg == BC.GetLibType() || r.BuildCFg == LibBuildConfig.General) { DllOut += "\"" + r.Path + "\", "; } } if (m.LaunguageType == ModuleDef.ProjectType.CSharp || m.LaunguageType == ModuleDef.ProjectType.ManagedCPP) { foreach (string s in m.NetReferences) { DllOut += "\"" + s + "\", "; } } ModuleDefManager.Instance.OnPreMakeAddLibs(m, BC, PD, ref DllOut); return(linkout + DllOut); }
public virtual void OnPreMakeAddLibs(ModuleDef m, BuildConfig BC, PlatformDefinition PD, ref string Dllout) { }