public virtual void ConfigureFastBuild(Configuration conf, CommonTarget target)
        {
            conf.SolutionFolder = "FastBuild/" + conf.SolutionFolder;
            conf.ProjectName   += "_FastBuild";

            conf.Defines.Add("USES_FASTBUILD");
        }
Esempio n. 2
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.AddPrivateDependency <StaticLib2Project>(target);

            conf.SolutionFolder = "StaticLibs";

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

            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);
            }
        }
 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;
 }
Esempio n. 4
0
        public override void ConfigureAll(Configuration conf, CommonTarget target)
        {
            base.ConfigureAll(conf, target);

            conf.SolutionFolder = "StaticLibs";

            conf.IncludePaths.Add(SourceRootPath);
        }
 public virtual void ConfigureAll(Configuration conf, CommonTarget target)
 {
     conf.SolutionFileName  = "[solution.Name]_[target.Platform]";
     conf.SolutionFileName += "_[target.DevEnv]";
     conf.PlatformName      = "[target.SolutionPlatformName]";
     // It's easy to setup Gradle when put solution file under the projects folder
     conf.SolutionPath = System.IO.Path.Combine(Globals.TmpDirectory, "projects");
 }
        public virtual void BlobNoBlob(Configuration conf, CommonTarget target)
        {
            conf.FastBuildBlobbed = false;
            conf.IsBlobbed        = false;

            if (conf.IsFastBuild)
            {
                conf.ProjectName += "_NoBlob";
            }
        }
Esempio n. 7
0
        public ExeProject()
        {
            AddTargets(CommonTarget.GetDefaultTargets());
            Name = "exe";

            SourceFilesExtensions.Add(".xml");
            SourceFilesExtensions.Add(".gradle");

            // Show resource files in project
            AdditionalSourceRootPaths.Add(Path.Combine(Globals.TmpDirectory, @"projects\[project.Name]"));
        }
Esempio n. 8
0
        public override void ConfigureAgde(Configuration conf, CommonTarget target)
        {
            base.ConfigureAgde(conf, target);

            conf.AddProject <ExeProject>(target);

            if (!_hasCopiedResources)
            {
                //copy top-level build gradle files to root dir
                AndroidUtil.DirectoryCopy(Path.Combine(conf.Solution.SharpmakeCsPath, @"..\gradle\root"), conf.SolutionPath);
                _hasCopiedResources = true;
            }
        }
Esempio n. 9
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";

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

            conf.Defines.Add("CREATION_DATE=\"April 2021\"");
        }
Esempio n. 10
0
        public override void ConfigureAgde(Configuration conf, CommonTarget target)
        {
            base.ConfigureAgde(conf, target);

            conf.IncludePaths.Add(@"$(AndroidNdkDirectory)\sources\android"); // For android_native_app_glue.h

            switch (target.AndroidBuildTargets)
            {
            case Android.AndroidBuildTargets.arm64_v8a:
                conf.TargetPath = Path.Combine(conf.TargetPath, "arm64-v8a");     // The gradle script require the outdir end of "arm64-v8a"
                break;

            case Android.AndroidBuildTargets.x86_64:
                conf.TargetPath = Path.Combine(conf.TargetPath, "x86_64");
                break;

            case Android.AndroidBuildTargets.armeabi_v7a:
                conf.TargetPath = Path.Combine(conf.TargetPath, "armeabi-v7a");
                break;

            case Android.AndroidBuildTargets.x86:
                conf.TargetPath = Path.Combine(conf.TargetPath, "x86");
                break;

            default:
                throw new System.Exception($"TODO, {target.AndroidBuildTargets} is not supported Android target for AGDE.");
            }
            conf.AdditionalLinkerOptions.Add("-llog", "-landroid");

            // Make sure the path of project exists as it is set to SourceRootPath.
            Resolver resolver = new Resolver();

            resolver.SetParameter("project", this);
            string projectPath = resolver.Resolve(conf.ProjectPath);

            if (!Directory.Exists(projectPath))
            {
                Directory.CreateDirectory(projectPath);
            }

            if (!_hasCopiedResources)
            {
                CopyAndroidResources(projectPath);
            }

            // The short name(libxxx.so, xxx is the short name) of App executable .so has to match the name of the project
            // because the native activity name is set to project.LowerName in AndroidManifest.xml.
            conf.TargetFileName = LowerName;
        }
        public static CommonTarget[] GetAndroidTargets()
        {
            var defaultTarget = new CommonTarget(
                Platform.agde,
                DevEnv.vs2019,
                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 });
        }
        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]");

            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.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
        }
Esempio n. 13
0
 public StaticLib2Project()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "static lib2";
 }
Esempio n. 14
0
 public HelloAndroidAgdeSolution()
 {
     AddTargets(CommonTarget.GetDefaultTargets());
     Name = "HelloAndroidAgde";
 }
 public virtual void ConfigureAgde(Configuration conf, CommonTarget target)
 {
 }
 public virtual void ConfigureAgde(Configuration conf, CommonTarget target)
 {
     conf.Options.Add(new Options.Android.General.AndroidGradleBuildDir("$(SolutionDir)"));
     conf.Options.Add(Options.Android.General.AndroidAPILevel.Latest); // This will set AndroidMinSdkVersion when project is for AGDE
     conf.Options.Add(Options.Android.General.UseOfStl.LibCpp_Shared);
 }
 public virtual void ConfigureDebug(Configuration conf, CommonTarget target)
 {
     conf.DefaultOption = Options.DefaultTarget.Debug;
 }
 public virtual void ConfigureRelease(Configuration conf, CommonTarget target)
 {
     conf.DefaultOption = Options.DefaultTarget.Release;
 }