Defining Library Projects

Library projects define a project which contains common functionality you want to share between multiple projects.

Generated projects

Library projects always generate appropriate projects such that other executable projects on the platform can refer and use them.

The appropriate information to reference library projects on any platform is automatically determined by Protobuild, so you don’t need to provide any additional information other than the library name when referencing it.

Basic structure

The smallest definition for an library project you can have is shown below.

<?xml version="1.0" encoding="utf-8"?>
<Project Name="MyLibrary" Path="MyLibrary" Type="Library">
  <References>
    <Reference Include="System" />
    <Reference Include="System.Core" />
  </References>
  <Files>
    <Compile Include="MyClass.cs" />
  </Files>
</Project>

The presence of Type="Library" ensures this project is an library project.

Project definition location

All project definitions for your module should be placed under the Build\Module directory and have a .definition extension. The name of the project should match the name of the file as well; for a project called “MyProject”, the project definition should reside at Build\Module\MyProject.definition.

Tip

This is the location for all project definitions, including application, console, library, content, include and external projects.

Common sections

All of the sections for library projects are identical to those found in application projects. Refer to the following sections under the Defining Application Projects documentation: