public string GetTargetString() { FieldInfo[] fieldInfos = GetFragmentFieldInfo(); string result = string.Join( "_", fieldInfos.Select( f => s_cachedFieldValueToString.GetOrAdd( f.GetValue(this), value => { if (value is Platform) { var platform = (Platform)value; if (platform >= Platform._reserved9) { return(Util.GetSimplePlatformString(platform).ToLower()); } } return(value.ToString()); } ) ) ); return(result); }
public override void AddCompilerSettings( IDictionary <string, CompilerSettings> masterCompilerSettings, Project.Configuration conf ) { var projectRootPath = conf.Project.RootPath; var devEnv = conf.Target.GetFragment <DevEnv>(); var platform = Platform.win64; // could also been retrieved from conf.Target.GetPlatform(), if we want string compilerName = "Compiler-" + Util.GetSimplePlatformString(platform); var platformToolset = Options.GetObject <Options.Vc.General.PlatformToolset>(conf); if (platformToolset.IsLLVMToolchain()) { var useClangCl = Options.GetObject <Options.Vc.LLVM.UseClangCl>(conf); // Use default platformToolset to get MS compiler instead of Clang, when ClangCl is disabled if (useClangCl == Options.Vc.LLVM.UseClangCl.Disable) { Options.Vc.General.PlatformToolset overridenPlatformToolset = Options.Vc.General.PlatformToolset.Default; if (Options.WithArgOption <Options.Vc.General.PlatformToolset> .Get <Options.Clang.Compiler.LLVMVcPlatformToolset>(conf, ref overridenPlatformToolset)) { platformToolset = overridenPlatformToolset; } else { platformToolset = Options.Vc.General.PlatformToolset.Default; } } } if (platformToolset != Options.Vc.General.PlatformToolset.Default && !platformToolset.IsDefaultToolsetForDevEnv(devEnv)) { compilerName += "-" + platformToolset; } else { compilerName += "-" + devEnv; } CompilerSettings compilerSettings = GetMasterCompilerSettings(masterCompilerSettings, compilerName, devEnv, projectRootPath, platformToolset, false); compilerSettings.PlatformFlags |= Platform.win64; SetConfiguration(conf, compilerSettings.Configurations, CppConfigName(conf), projectRootPath, devEnv, false); }
public override void AddCompilerSettings(IDictionary <string, CompilerSettings> masterCompilerSettings, Project.Configuration conf) { var devEnv = conf.Target.GetFragment <DevEnv>(); var fastBuildSettings = PlatformRegistry.Get <IFastBuildCompilerSettings>(Platform.linux); var platform = conf.Target.GetFragment <Platform>(); string compilerName = $"Compiler-{Util.GetSimplePlatformString(platform)}-{devEnv}"; string CCompilerSettingsName = "C-" + compilerName + "-" + "Linux"; string CompilerSettingsName = compilerName + "-" + "Linux"; var projectRootPath = conf.Project.RootPath; CompilerSettings compilerSettings = GetMasterCompilerSettings(masterCompilerSettings, CompilerSettingsName, devEnv, projectRootPath, false); compilerSettings.PlatformFlags |= Platform.linux; CompilerSettings CcompilerSettings = GetMasterCompilerSettings(masterCompilerSettings, CCompilerSettingsName, devEnv, projectRootPath, true); CcompilerSettings.PlatformFlags |= Platform.linux; SetConfiguration(compilerSettings, CompilerSettingsName, projectRootPath, devEnv, false); SetConfiguration(CcompilerSettings, CCompilerSettingsName, projectRootPath, devEnv, true); }