示例#1
0
        public void ConfigureDemo(Configuration conf, DearTarget target)
        {
            conf.Output = Configuration.OutputType.Exe;
            conf.AddPrivateDependency <APIProject>(target);
            conf.TargetPath = RootPath + "/WorkingDir";

            conf.IncludePaths.Add(@"[project.RootPath]/src/demo/");
            conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/backends/");
            //conf.IncludePrivatePaths.Add(@"[project.RootPath]\codebase\SpanMultipleSrcDirs\dir_individual_files");
            //conf.AddPrivateDependency<CoreProject>(target);

            //SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_opengl3.h");
            //SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_opengl3.cpp");
            //SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_glfw.h");
            //SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_glfw.cpp");

            if (target.Api == TargetAPI.D3D11)
            {
                conf.LibraryFiles.Add("d3d11.lib");
                conf.LibraryFiles.Add("d3dcompiler.lib");
                conf.LibraryFiles.Add("dxgi.lib");
            }
            //if (target.Build == BuildType.DemoOnly)
            //{
            //    if (target.Api == TargetAPI.D3D11)
            //    {
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_dx11.h");
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_dx11.cpp");
            //    }

            //    if (target.Api == TargetAPI.D3D12)
            //    {
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_dx12.h");
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_dx12.cpp");
            //    }

            //    if (target.Api == TargetAPI.OpenGL3)
            //    {
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_opengl3.h");
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_opengl3.cpp");
            //    }

            //    if (target.Api == TargetAPI.Vulkan)
            //    {
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_vulkan.h");
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_vulkan.cpp");
            //    }

            //    if (target.Api == TargetAPI.WGPU)
            //    {
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_wgpu.h");
            //        SourceFiles.Add("[project.ExternPath]/imgui/backends/imgui_impl_wgpu.cpp");
            //    }
            //}

            conf.VcxprojUserFile = new Configuration.VcxprojUserFileSettings();
            conf.VcxprojUserFile.LocalDebuggerWorkingDirectory = @"[project.RootPath]/WorkingDir/";
            //@"$(SolutionDir)WorkingDir";
        }
示例#2
0
 [Configure(Optimization.Release)]//, ConfigurePriority(3)]
 public virtual void ConfigureRelease(Configuration conf, DearTarget target)
 {
     conf.Options.Add(Sharpmake.Options.Vc.Compiler.Optimization.MaximizeSpeed);
     conf.Options.Add(Sharpmake.Options.Vc.General.WholeProgramOptimization.LinkTime);
     conf.Options.Add(Sharpmake.Options.Vc.Linker.LinkTimeCodeGeneration.UseLinkTimeCodeGeneration);
     conf.Options.Add(Sharpmake.Options.Vc.Linker.EnableCOMDATFolding.RemoveRedundantCOMDATs);
     conf.Options.Add(Sharpmake.Options.Vc.Linker.Reference.EliminateUnreferencedData);
 }
示例#3
0
 public virtual void ConfigureWindows(Configuration conf, DearTarget target)
 {
     conf.Defines.Add("__DEAR_WIN__");
     conf.LibraryFiles.Add("Wtsapi32");             // Enables applications to receive WTS messages from windows
     conf.AdditionalLinkerOptions.Add("/ignore:4098,4099,4217,4221");
     conf.Defines.Add("WINAPI_FAMILY=WINAPI_FAMILY_DESKTOP_APP");
     conf.Defines.Add("_WIN32_WINNT=0x0600");
     conf.Options.Add(Sharpmake.Options.Vc.Linker.RandomizedBaseAddress.Disable);
 }
示例#4
0
        public virtual void ConfigureAll(Configuration conf, DearTarget target)
        {
            AddPlatformSourceExclusion(conf, target);

            conf.Name              = "[target.Api]_[target.Optimization]";
            conf.ProjectFileName   = "[project.Name]_[target.DevEnv]_[target.Platform]";
            conf.ProjectPath       = ProjectsPath + @"\[target.Platform]\[target.Build]\[project.Name]";
            conf.IntermediatePath  = @"[project.TmpPath]\[target.Api]\[target.Platform]\[project.Name]\[target.Optimization]";
            conf.TargetPath        = @"[project.OutputPath]";
            conf.TargetLibraryPath = @"[project.RootPath]\tmp\lib\[target.Platform]_[target.Api]_[target.Optimization]";

            conf.IncludePaths.Add(@"[project.RootPath]\src\api");
            conf.IncludePaths.Add(@"[project.RootPath]\");
            conf.IncludePaths.Add(@"[project.ExternPath]");

            conf.Defines.Add("ImDrawIdx=ImU32");
            conf.Defines.Add("IMGUI_DEFINE_MATH_OPERATORS");
            conf.Defines.Add("IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
            //conf.IncludePaths.Add(@"[project.ExternPath]/imgui/");
            conf.IncludePaths.Add(@"[project.RootPath]/extern/imgui/");
            conf.IncludePaths.Add(@"[project.ExternPath]/glad/include");

            //conf.Defines.Add("_CRT_SECURE_NO_WARNINGS");
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.Inline.Disable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.CppLanguageStandard.Latest);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.CompileAsWinRT.Disable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.RTTI.Disable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.FloatingPointExceptions.Disable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.FloatingPointModel.Fast);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.EnhancedInstructionSet.AdvancedVectorExtensions);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.Exceptions.Enable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.Intrinsic.Enable);
            conf.Options.Add(Sharpmake.Options.Vc.Compiler.ConformanceMode.Enable);

            conf.AdditionalCompilerOptions.Add("/Zo");
            conf.Options.Add(new Sharpmake.Options.Vc.Librarian.DisableSpecificWarnings(
                                 "4221" // This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
                                 ));

            //conf.Options.Add(new Sharpmake.Options.Vc.Compiler.DisableSpecificWarnings(
            //    //"4100", // unreferenced formal parameter
            //    "4324"  // structure was padded due to alignment specifier
            //    ));

            conf.Defines.Add("NOMINMAX");

            if (target.Optimization == Optimization.Debug)
            {
                conf.Defines.Add("__DEAR_DEBUG__");
            }
            else
            {
                conf.Defines.Add("__DEAR_RELEASE__");
            }
            //conf.Defines.Add("ImDrawIdx=unsigned int");
        }
示例#5
0
        public void ConfigureAPI(Configuration conf, DearTarget target)
        {
            conf.Output = Configuration.OutputType.Lib;
            //conf.AddPrivateDependency<KernelProject>(target);
            //conf.AddPrivateDependency<CoreProject>(target);

            //conf.Defines.Add("IMGUI_DEFINE_MATH_OPERATORS");
            //conf.IncludePaths.Add(@"[project.RootPath]/extern/Clipper/cpp/");
            //conf.IncludePaths.Add(@"[project.ExternPath]/glad/include");
        }
示例#6
0
        public void ConfigureAll(Configuration conf, DearTarget target)
        {
            conf.Name = "[target.Api]_[target.Optimization]";

            conf.SolutionFileName = "[solution.Name]_[target.Build]_[target.Platform]_[target.Api]";

            conf.SolutionPath = SolutionRootPath;

            if (target.Build == BuildType.APIOnly || target.Build == BuildType.Full)
            {
                conf.AddProject <APIProject>(target);
            }
            if (target.Build == BuildType.DemoOnly || target.Build == BuildType.Full)
            {
                conf.AddProject <DemoProject>(target);
            }
        }
示例#7
0
        public virtual void OutputTypeLib(Configuration conf, DearTarget target)
        {
            if (target.Platform == Platform.win64)
            {
                if (target.Optimization == Optimization.Debug)
                {
                    conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreadedDebug);
                }
                else
                {
                    conf.Options.Add(Sharpmake.Options.Vc.Compiler.RuntimeLibrary.MultiThreaded);
                }
            }

            if (target.Platform == Platform.win64)
            {
                //conf.Options.Add(Sharpmake.Options.Vc.General.NativeEnvironment.Enable);
                conf.Options.Add(Options.Vc.General.PreferredToolArchitecture.x64);
            }
        }
示例#8
0
        void AddPlatformSourceExclusion(Configuration conf, DearTarget target)
        {
            var excludedFileSuffixes = new List <string>();
            var excludedFolders      = new List <string>();

            if (target.Api != TargetAPI.D3D12)
            {
                excludedFileSuffixes.Add("dx12");
                //excludedFolders.Add("dx12");
            }

            if (target.Api != TargetAPI.Vulkan)
            {
                excludedFileSuffixes.Add("vulkan");
                //excludedFolders.Add("vulkan");
            }

            if (target.Api != TargetAPI.D3D11)
            {
                excludedFileSuffixes.Add("dx11");
                //excludedFolders.Add("dx11");
            }

            if (target.Api != TargetAPI.OpenGL3)
            {
                excludedFileSuffixes.Add("opengl3");
                //excludedFolders.Add("opengl3");
            }

            if (target.Api != TargetAPI.WGPU)
            {
                excludedFileSuffixes.Add("wgpu");
                //excludedFolders.Add("wgpu");
            }

            conf.SourceFilesBuildExcludeRegex.Add(@"\.*_(" + string.Join("|", excludedFileSuffixes.ToArray()) + @")\.cpp$");
            //conf.SourceFilesBuildExcludeRegex.Add(@"\.*_(" + string.Join("|", excludedFileSuffixes.ToArray()) + @")\.h$");
            //conf.SourceFilesBuildExcludeRegex.Add(@"\.*\\(" + string.Join("|", excludedFolders.ToArray()) + @")\\");
        }
示例#9
0
 public virtual void ConfigureWGPU(Configuration conf, DearTarget target)
 {
     conf.Defines.Add("__DEAR_WGPU__");
 }
示例#10
0
 public virtual void ConfigureVulkan(Configuration conf, DearTarget target)
 {
     conf.Defines.Add("__DEAR_GFX_VULKAN__");
 }
示例#11
0
 public virtual void ConfigureOpenGL3(Configuration conf, DearTarget target)
 {
     conf.Defines.Add("__DEAR_GFX_OGL3__");
 }
示例#12
0
 public virtual void ConfigureD3D12(Configuration conf, DearTarget target)
 {
     conf.Defines.Add("__DEAR_GFX_D3D12__");
 }
示例#13
0
 [Configure(Optimization.Debug)]//, ConfigurePriority(2)]
 public virtual void ConfigureDebug(Configuration conf, DearTarget target)
 {
     conf.Options.Add(Sharpmake.Options.Vc.Compiler.Inline.Disable);
 }