public virtual void FastBuildUnitys(Configuration conf, CommonTarget target)
 {
     conf.FastBuildBlobbed          = true;
     conf.FastBuildUnityPath        = Path.Combine(Globals.TmpDirectory, @"unity\[project.Name]");
     conf.IncludeBlobbedSourceFiles = false;
     conf.IsBlobbed = false;
 }
        public virtual void ConfigureFastBuild(Configuration conf, CommonTarget target)
        {
            conf.SolutionFolder = "FastBuild/" + conf.SolutionFolder;
            conf.ProjectName   += "_FastBuild";

            conf.Defines.Add("USES_FASTBUILD");
        }
        public virtual void ConfigureAll(Configuration conf, CommonTarget target)
        {
            conf.ProjectFileName = "[project.Name]_[target.Platform]";
            if (target.DevEnv != DevEnv.xcode4ios)
            {
                conf.ProjectFileName += "_[target.DevEnv]";
            }
            conf.ProjectPath = Path.Combine(Globals.TmpDirectory, @"projects\[project.Name]");
            conf.IsFastBuild = target.BuildSystem == BuildSystem.FastBuild;

            conf.IntermediatePath = Path.Combine(Globals.TmpDirectory, @"obj\[target.DirectoryName]\[project.Name]");
            conf.TargetPath       = Path.Combine(Globals.OutputDirectory, "[target.DirectoryName]");

            // Note: uncomment the following line if we port this sample to windows
            //conf.TargetLibraryPath = conf.IntermediatePath; // .lib files must be with the .obj files when running in fastbuild distributed mode or we'll have missing symbols due to merging of the .pdb
            conf.TargetLibraryPath = Path.Combine(Globals.TmpDirectory, @"lib\[target.DirectoryName]\[project.Name]");

            // TODO: uncomment and fix this. Didn't find a way to have product with
            //       different names per configurations to work properly...
            //conf.TargetFileName += "_" + target.Optimization.ToString().ToLowerInvariant().First(); // suffix with lowered first letter of optim
            //if (conf.IsFastBuild)
            //conf.TargetFileName += "x";

            conf.Output = Configuration.OutputType.Lib; // defaults to creating static libs

            // Create a separate package directory before building.
            string packageDir = $@"{RootPath}\package";

            conf.EventPreBuild.Add($"mkdir {packageDir}");
            // Copy the build artifacts to the package directory.
            conf.EventPostBuild.Add($@"cp [conf.TargetPath]\[project.Name].* {packageDir}");
        }
Пример #4
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.SolutionFolder = "StaticLibs";

            // intentionally in a subfolder
            conf.PrecompHeader = @"src\pch.h";
            conf.PrecompSource = @"src\pch.cpp";

            // becase this lib will be used in a shared lib, we need it to be position independent
            conf.AdditionalCompilerOptions.Add("-fPIC");

            conf.IncludePaths.Add(SourceRootPath);

            switch (target.Optimization)
            {
            case Optimization.Debug:
                conf.SourceFilesBuildExclude.Add(@"src\ensure_release.cpp");
                break;

            case Optimization.Release:
                // use a different method to exclude ensure_debug.cpp
                conf.SourceFilesBuildExcludeRegex.Add(Util.RegexPathCombine("src", @"ensure_d.*\.cpp$"));
                break;

            default:
                throw new Error("Unexpected optimization " + target.Optimization);
            }
        }
Пример #5
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.SolutionFolder = "StaticLibs";

            conf.IncludePaths.Add(SourceRootPath);
        }
Пример #6
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.AddProject <ExeProject>(target);
            conf.AddProject <Dll1Project>(target);
            conf.AddProject <StaticLib1Project>(target);
            conf.AddProject <StaticLib2Project>(target);
        }
        public virtual void BlobNoBlob(Configuration conf, CommonTarget target)
        {
            conf.FastBuildBlobbed = false;
            conf.IsBlobbed        = false;

            if (conf.IsFastBuild)
            {
                conf.ProjectName += "_NoBlob";
            }
        }
 public virtual void ConfigureAll(Configuration conf, CommonTarget target)
 {
     conf.SolutionFileName = "[solution.Name]_[target.Platform]";
     if (target.DevEnv != DevEnv.xcode4ios)
     {
         conf.SolutionFileName += "_[target.DevEnv]";
     }
     conf.PlatformName = "[target.SolutionPlatformName]";
     conf.SolutionPath = System.IO.Path.Combine(Globals.TmpDirectory, "solutions");
 }
 public virtual void PostConfigureAll(Configuration conf, CommonTarget target)
 {
     if (conf.Output == Configuration.OutputType.Exe || conf.Output == Configuration.OutputType.Dll)
     {
         // Create a separate package directory before building.
         string packageDir = $@"{Globals.TmpDirectory}/package";
         conf.EventPreBuild.Add($"mkdir -p {packageDir}");
         // Copy the build result to the package directory.
         conf.EventPostBuild.Add($@"cp [conf.TargetPath]/[conf.TargetFileFullNameWithExtension] {packageDir}");
     }
 }
Пример #10
0
        public static CommonTarget[] GetLinuxTargets()
        {
            var defaultTarget = new CommonTarget(
                Platform.linux,
                DevEnv.make,
                Optimization.Debug | Optimization.Release,
                Blob.NoBlob,
                BuildSystem.Default
                );

            // make a fastbuild version of the target
            var fastBuildTarget = (CommonTarget)defaultTarget.Clone(
                Blob.FastBuildUnitys,
                BuildSystem.FastBuild
                );

            return(new[] { defaultTarget });
        }
Пример #11
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.Output = Configuration.OutputType.Exe;

            conf.PrecompHeader = "stdafx.h";
            conf.PrecompSource = "stdafx.cpp";

            // this tells the shared lib loader to look in the exe dir
            // note: because we write in makefiles we double the $ to escape it
            conf.AdditionalLinkerOptions.Add("-Wl,-rpath='$$ORIGIN'");

            conf.AddPrivateDependency <Dll1Project>(target);
            conf.AddPrivateDependency <StaticLib2Project>(target);

            conf.Defines.Add("CREATION_DATE=\"October 2020\"");
        }
Пример #12
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.SolutionFolder = "SharedLibs";

            conf.PrecompHeader = "precomp.h";
            conf.PrecompSource = "precomp.cpp";

            conf.Output = Configuration.OutputType.Dll;
            conf.AdditionalCompilerOptions.Add("-fPIC");

            conf.Defines.Add("UTIL_DLL_EXPORT");
            conf.ExportDefines.Add("UTIL_DLL_IMPORT");

            conf.IncludePaths.Add(SourceRootPath);

            conf.AddPrivateDependency <StaticLib1Project>(target);
        }
Пример #13
0
 public HelloLinuxSolution()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "HelloLinux";
 }
 public virtual void ConfigureRelease(Configuration conf, CommonTarget target)
 {
     conf.DefaultOption = Options.DefaultTarget.Release;
 }
 public virtual void ConfigureDebug(Configuration conf, CommonTarget target)
 {
     conf.DefaultOption = Options.DefaultTarget.Debug;
 }
 public virtual void ConfigureLinux(Configuration conf, CommonTarget target)
 {
 }
Пример #17
0
 public ExeProject()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "exe";
 }
Пример #18
0
 public Dll1Project()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "dll1";
 }
Пример #19
0
 public StaticLib2Project()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "static lib2";
 }