GPR User Guide
Contents:
Introduction
Your First Project
Managing Sources
Building Executables
Scenarios
Libraries
Organizing Multi-Project Systems
Project Extension
Aggregate Projects
Working with Tools
Best Practices
GNU Free Documentation License
Index
GPR User Guide
GPR User Guide
View page source
GPR User Guide
Version 27.0w
Date: Jun 05, 2026
Contents:
Introduction
What is GPR?
Attributes
Your First Project
A minimal project
Project declaration
Source directories
Languages
Object and executable directories
Main subprograms
Compiler switches
What GPRbuild does
Next steps
Managing Sources
How source discovery works
Source directories
Explicit source lists
Excluding sources
Ada naming conventions
Multiple suffixes per language
Building Executables
Entry points
Executable names
Compiler switches
Linker switches
Binder switches
Global build switches
Common GPRbuild options
Out-of-tree builds
Scenarios
External variables
Typed variables
case
statements
Multiple scenario variables
Sharing scenario variables
Libraries
Declaring a library project
Library kinds
Stand-alone libraries
Controlling source visibility
Aggregate library projects
Organizing Multi-Project Systems
Why multiple projects?
Importing a project with
with
Limited
with
The project tree
Typical layout
Project Extension
Basic syntax
What is inherited
Overriding sources
Overriding attributes and packages
Abstract base projects
Import redirection
extends
all
Aggregate Projects
Basic syntax
Use cases
Restrictions
Working with Tools
Tools that operate on project trees
Tools that generate project files
Best Practices
Project layout
Scenario variables
Object and output directories
Multi-project hygiene
Performance
GNU Free Documentation License