📄 msvc_prj_generator.cpp
字号:
/* * =========================================================================== * PRODUCTION $Log: msvc_prj_generator.cpp,v $ * PRODUCTION Revision 1000.2 2004/06/16 17:02:30 gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.35 * PRODUCTION * =========================================================================== */#include <ncbi_pch.hpp>#include <app/project_tree_builder/msvc_prj_generator.hpp>#include <app/project_tree_builder/proj_builder_app.hpp>#include <app/project_tree_builder/msvc_project_context.hpp>#include <app/project_tree_builder/msvc_prj_utils.hpp>#include <app/project_tree_builder/msvc_prj_defines.hpp>#include <app/project_tree_builder/msvc_prj_files_collector.hpp>#include <algorithm>BEGIN_NCBI_SCOPEstatic void s_CreateDatatoolCustomBuildInfo(const CProjItem& prj, const CMsvcPrjProjectContext& context, const CDataToolGeneratedSrc& src, SCustomBuildInfo* build_info);//-----------------------------------------------------------------------------CMsvcProjectGenerator::CMsvcProjectGenerator(const list<SConfigInfo>& configs) :m_Configs(configs){}CMsvcProjectGenerator::~CMsvcProjectGenerator(void){}void CMsvcProjectGenerator::Generate(const CProjItem& prj){ // Already have it if ( prj.m_ProjType == CProjKey::eMsvc) return; CMsvcPrjProjectContext project_context(prj); CVisualStudioProject xmlprj; // Checking configuration availability: list<SConfigInfo> project_configs; ITERATE(list<SConfigInfo>, p , m_Configs) { const SConfigInfo& cfg_info = *p; // Check config availability if ( !project_context.IsConfigEnabled(cfg_info) ) { LOG_POST(Info << "Configuration " << cfg_info.m_Name << " disabled in project " << project_context.ProjectId()); } else { project_configs.push_back(cfg_info); } } {{ // Attributes: xmlprj.SetAttlist().SetProjectType (MSVC_PROJECT_PROJECT_TYPE); xmlprj.SetAttlist().SetVersion (MSVC_PROJECT_VERSION); xmlprj.SetAttlist().SetName (project_context.ProjectName()); xmlprj.SetAttlist().SetKeyword (MSVC_PROJECT_KEYWORD_WIN32); }} {{ // Platforms CRef<CPlatform> platform(new CPlatform("")); platform->SetAttlist().SetName(MSVC_PROJECT_PLATFORM); xmlprj.SetPlatforms().SetPlatform().push_back(platform); }} ITERATE(list<SConfigInfo>, p , project_configs) { const SConfigInfo& cfg_info = *p; // Contexts: CMsvcPrjGeneralContext general_context(cfg_info, project_context); // MSVC Tools CMsvcTools msvc_tool(general_context, project_context); CRef<CConfiguration> conf(new CConfiguration());#define BIND_TOOLS(tool, msvctool, X) \ tool->SetAttlist().Set##X(msvctool->X()) {{ //Configuration //Name BIND_TOOLS(conf, msvc_tool.Configuration(), Name); //OutputDirectory BIND_TOOLS(conf, msvc_tool.Configuration(), OutputDirectory); //IntermediateDirectory BIND_TOOLS(conf, msvc_tool.Configuration(), IntermediateDirectory); //ConfigurationType BIND_TOOLS(conf, msvc_tool.Configuration(), ConfigurationType); //CharacterSet BIND_TOOLS(conf, msvc_tool.Configuration(), CharacterSet); }} {{ //Compiler CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.Compiler(), Name); //Optimization BIND_TOOLS(tool, msvc_tool.Compiler(), Optimization); //AdditionalIncludeDirectories - more dirs are coming from makefile BIND_TOOLS(tool, msvc_tool.Compiler(), AdditionalIncludeDirectories); //PreprocessorDefinitions BIND_TOOLS(tool, msvc_tool.Compiler(), PreprocessorDefinitions); //MinimalRebuild BIND_TOOLS(tool, msvc_tool.Compiler(), MinimalRebuild); //BasicRuntimeChecks BIND_TOOLS(tool, msvc_tool.Compiler(), BasicRuntimeChecks); //RuntimeLibrary BIND_TOOLS(tool, msvc_tool.Compiler(), RuntimeLibrary); //RuntimeTypeInfo BIND_TOOLS(tool, msvc_tool.Compiler(), RuntimeTypeInfo); //UsePrecompiledHeader BIND_TOOLS(tool, msvc_tool.Compiler(), UsePrecompiledHeader); //WarningLevel BIND_TOOLS(tool, msvc_tool.Compiler(), WarningLevel); //Detect64BitPortabilityProblems BIND_TOOLS(tool, msvc_tool.Compiler(), Detect64BitPortabilityProblems); //DebugInformationFormat BIND_TOOLS(tool, msvc_tool.Compiler(), DebugInformationFormat); //CompileAs BIND_TOOLS(tool, msvc_tool.Compiler(), CompileAs); //InlineFunctionExpansion BIND_TOOLS(tool, msvc_tool.Compiler(), InlineFunctionExpansion); //OmitFramePointers BIND_TOOLS(tool, msvc_tool.Compiler(), OmitFramePointers); //StringPooling BIND_TOOLS(tool, msvc_tool.Compiler(), StringPooling); //EnableFunctionLevelLinking BIND_TOOLS(tool, msvc_tool.Compiler(), EnableFunctionLevelLinking); //OptimizeForProcessor BIND_TOOLS(tool, msvc_tool.Compiler(), OptimizeForProcessor); //StructMemberAlignment BIND_TOOLS(tool, msvc_tool.Compiler(), StructMemberAlignment); //CallingConvention BIND_TOOLS(tool, msvc_tool.Compiler(), CallingConvention); //IgnoreStandardIncludePath BIND_TOOLS(tool, msvc_tool.Compiler(), IgnoreStandardIncludePath); //ExceptionHandling BIND_TOOLS(tool, msvc_tool.Compiler(), ExceptionHandling); //BufferSecurityCheck BIND_TOOLS(tool, msvc_tool.Compiler(), BufferSecurityCheck); //DisableSpecificWarnings BIND_TOOLS(tool, msvc_tool.Compiler(), DisableSpecificWarnings); //UndefinePreprocessorDefinitions BIND_TOOLS(tool, msvc_tool.Compiler(), UndefinePreprocessorDefinitions); //AdditionalOptions BIND_TOOLS(tool, msvc_tool.Compiler(), AdditionalOptions); //GlobalOptimizations BIND_TOOLS(tool, msvc_tool.Compiler(), GlobalOptimizations); //FavorSizeOrSpeed BIND_TOOLS(tool, msvc_tool.Compiler(), FavorSizeOrSpeed); //BrowseInformation BIND_TOOLS(tool, msvc_tool.Compiler(), BrowseInformation); conf->SetTool().push_back(tool); }} {{ //Linker CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.Linker(), Name); //AdditionalOptions BIND_TOOLS(tool, msvc_tool.Linker(), AdditionalOptions); //OutputFile BIND_TOOLS(tool, msvc_tool.Linker(), OutputFile); //LinkIncremental BIND_TOOLS(tool, msvc_tool.Linker(), LinkIncremental); //GenerateDebugInformation BIND_TOOLS(tool, msvc_tool.Linker(), GenerateDebugInformation); //ProgramDatabaseFile BIND_TOOLS(tool, msvc_tool.Linker(), ProgramDatabaseFile); //SubSystem BIND_TOOLS(tool, msvc_tool.Linker(), SubSystem); //ImportLibrary BIND_TOOLS(tool, msvc_tool.Linker(), ImportLibrary); //TargetMachine BIND_TOOLS(tool, msvc_tool.Linker(), TargetMachine); //OptimizeReferences BIND_TOOLS(tool, msvc_tool.Linker(), OptimizeReferences); //EnableCOMDATFolding BIND_TOOLS(tool, msvc_tool.Linker(), EnableCOMDATFolding); //IgnoreAllDefaultLibraries BIND_TOOLS(tool, msvc_tool.Linker(), IgnoreAllDefaultLibraries); //IgnoreDefaultLibraryNames BIND_TOOLS(tool, msvc_tool.Linker(), IgnoreDefaultLibraryNames); //AdditionalLibraryDirectories BIND_TOOLS(tool, msvc_tool.Linker(), AdditionalLibraryDirectories); conf->SetTool().push_back(tool); }} {{ //Librarian CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.Librarian(), Name); //AdditionalOptions BIND_TOOLS(tool, msvc_tool.Librarian(), AdditionalOptions); //OutputFile BIND_TOOLS(tool, msvc_tool.Librarian(), OutputFile); //IgnoreAllDefaultLibraries BIND_TOOLS(tool, msvc_tool.Librarian(), IgnoreAllDefaultLibraries); //IgnoreDefaultLibraryNames BIND_TOOLS(tool, msvc_tool.Librarian(), IgnoreDefaultLibraryNames); //AdditionalLibraryDirectories BIND_TOOLS(tool, msvc_tool.Librarian(), AdditionalLibraryDirectories); conf->SetTool().push_back(tool); }} {{ //CustomBuildTool CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.CustomBuid(), Name); conf->SetTool().push_back(tool); }} {{ //MIDL CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.MIDL(), Name); conf->SetTool().push_back(tool); }} {{ //PostBuildEvent CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.PostBuildEvent(), Name); conf->SetTool().push_back(tool); }} {{ //PreBuildEvent CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.PreBuildEvent(), Name); //CommandLine BIND_TOOLS(tool, msvc_tool.PreBuildEvent(), CommandLine); conf->SetTool().push_back(tool); }} {{ //PreLinkEvent CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.PreLinkEvent(), Name); conf->SetTool().push_back(tool); }} {{ //ResourceCompiler CRef<CTool> tool(new CTool("")); //Name BIND_TOOLS(tool, msvc_tool.ResourceCompiler(), Name); //AdditionalIncludeDirectories BIND_TOOLS(tool, msvc_tool.ResourceCompiler(), AdditionalIncludeDirectories); //AdditionalOptions BIND_TOOLS(tool, msvc_tool.ResourceCompiler(), AdditionalOptions); //Culture BIND_TOOLS(tool, msvc_tool.ResourceCompiler(), Culture);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -