170 likes | 272 Views
Integrating a custom tool-chain in CDT. Instructors. Mikhail Sennikovsky Intel Corporation CDT Committer mikhail.sennikovsky@intel.com Mikhail Voronin Intel Corporation mikhail.voronin@intel.com. Agenda. The purpose of the tutorial Tools integration in CDT CDT Infrastructure outline
E N D
Instructors Mikhail Sennikovsky Intel Corporation CDT Committer mikhail.sennikovsky@intel.com Mikhail Voronin Intel Corporation mikhail.voronin@intel.com
Agenda • The purpose of the tutorial • Tools integration in CDT • CDT Infrastructure outline • Tool-chain integration mechanism • Tutorials • Tutorial 1: Two-step tool-chain definition • Tutorial 2: Populating tool-chain with the settings info • Tutorial 3: Extending tool-chain to support “Managed” Build • Tutorial 4: Advanced “Managed” Build settings customization • Tutorial 5: API overview • Q & A
Purpose • Understand the CDT tool-chain integration mechanism • Learn how to make a deep integration of a custom tool-chain into the CDT
Tools integration in CDT • Multi-language support • C/C++ IDE becomes Compiled Languages IDE • Photran based on CDT • Compilers co-existence • Can easily switch from gcc to another integrated compiler • Per-folder/file settings • Debuggers • Potentially other debuggers than gdb can be integrated as well • Builders • GNU Make and Internal builder are available by default • CDT is open for others!
Way to integrate • Compiler’s example: • Adding Language entry • Build options definitions in MBS • Information on built-in symbols and includes • Build environment • Error parser
CDT Infrastructure outline • CDT Core • Project settings infrastructure • Source Code navigation/manipulation • Binary file navigation CConfigurationDataProvider mechanism • CDT Build System • Build Functionality • Providing tool-chain settings to the core and debug components CDT Debug buildDefinitions mechanism Tool-chain Definitions
Tool-chain integration mechanism • Build System customization • Build behavior definition • Build behavior and logic for “Managed” Builds • Build command for “Standard” Builds • Build Settings UI for “Managed” builds • Integration in the New Project Wizard • Providing settings to other parts of the CDT • Is a profile for holding settings: Built-in Includes and Symbols, Build Environment, Error parsers, Binary parsers • Defined by the tool-chain integrator • Customizable for specific project • Settings get applied when the toolchain is assigned to the project • On project creation • On tool-chain substitution/modification
Project Build Setting UI Tool Defintion (plugin.xml) Build behavior definition (Managed Build) for Intel Fortran compiler <tool ... id="photran.managedbuild.tool.intel.fortran.compiler" name="Intel Fortran Compiler“ command="ifort"> ... <option command="-I" id="intel.linux.fortran.compiler.preprocessor.includedirectories" name="Additional Include Directories (-I)" valueType="includePath“ browseType="directory"> Generated makefile Tool option values defintion (.cproject) <tool ... superClass="photran.managedbuild.tool.intel.fortran.compiler"> <option ... superClass="intel.linux.fortran.compiler.preprocessor.includedirectories"> <listOptionValue value="c:\test\dir"/> ...
New Project Wizard customization for Intel Fortran compiler New Project Wizard Project Type definition <projectType buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" ... > <configuration ...> <toolChain name="Intel IA-32 Fortran Tool Chain" ...> ... Build Artifact type definition <extension point="org.eclipse.cdt.managedbuilder.core.buildProperties" ...> ... <propertyTypeid="org.eclipse.cdt.build.core.buildArtefactType" name="%BuildProperty.type.name.buildArtefactType"/> <propertyValue property="org.eclipse.cdt.build.core.buildArtefactType" id="org.eclipse.cdt.build.core.buildArtefactType.exe" name="Executable"/> </extension>
Tutorials • Tutorial 1: Two-step tool-chain definition • Tutorial 2: Populating tool-chain with the settings info • Tutorial 3: Extending tool-chain to support “Managed” Build • Tutorial 4: Advanced “Managed” Build settings customization • Tutorial 5: API overview
Tutorial 1: Two-step tool-chain definition • Tool-chain • Builder • Tools
Tutorial 2: Populating tool-chain with the settings info • Tool-chain • Binary parsers • Build environment • Builder • Build command • Build behavior for each eclipse build type • Builder error parser • Tools • Error parsers • Built-in Includes/Symbols discovery
Tutorial 3: Extending tool-chain to support “Managed” Build • Builder • Buildfile generator • CDT Internal Builder • Tools • Options • Project-type
Tutorial 4: Advanced “Managed” Build settings customization • Build settings and behavior • Option enablement expressions • Option value handlers • Option applicability calculators • New Project Wizard integration
Tutorial 5: API overview • Build System API • ManagedBuildManager • Using Core API for accessing/modifying the Build settings • ICProjectDescriptionManager