Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::Build::Project Struct Reference

Groups multiple Configuration and source files with their compile and link flags. More...

#include <Build.h>

Classes

struct  File
 Project list of files. More...
 

Public Member Functions

 Project (TargetType::Type targetType, StringView name)
 
bool setRootDirectory (StringView file)
 Set root directory for this project (all relative paths will be relative to this one) More...
 
bool addPresetConfiguration (Configuration::Preset preset, const Parameters &parameters, StringView configurationName=StringView())
 Add a configuration with a given name, started by cloning options of a specific Preset. More...
 
ConfigurationgetConfiguration (StringView configurationName)
 Get Configuration with the matching configurationName More...
 
const ConfigurationgetConfiguration (StringView configurationName) const
 Get Configuration with the matching configurationName More...
 
bool addDirectory (StringView subdirectory, StringView filter)
 Add all files from specific subdirectory (relative to project root) matching given filter. More...
 
bool addFile (StringView singleFile)
 Add a single file to the project. More...
 
bool removeFiles (StringView subdirectory, StringView filter)
 Remove files matching the given filter. More...
 
Result validate () const
 Validates this project for it to contain a valid combination of flags. More...
 

Public Attributes

TargetType::Type targetType = TargetType::Executable
 Type of build artifact. More...
 
String name
 Project name. More...
 
String rootDirectory
 Project root directory. More...
 
String targetName
 Project target name. More...
 
String iconPath
 Icon location. More...
 
Vector< Filefiles
 Files that belong to the project. More...
 
CompileFlags compile
 Shared CompileFlags for all files in the project. More...
 
LinkFlags link
 Shared LinkFlags for all files in the project. More...
 
Vector< Configurationconfigurations
 Build configurations created inside the project. More...
 

Detailed Description

Groups multiple Configuration and source files with their compile and link flags.

Member Function Documentation

◆ addDirectory()

bool SC::Build::Project::addDirectory ( StringView  subdirectory,
StringView  filter 
)

Add all files from specific subdirectory (relative to project root) matching given filter.

Parameters
subdirectoryThe subdirectory to search files from, absolute or relative to project root. No * allowed.
filterThe suffix filter that is appended to subdirectory (can contain *)

◆ addFile()

bool SC::Build::Project::addFile ( StringView  singleFile)

Add a single file to the project.

◆ addPresetConfiguration()

bool SC::Build::Project::addPresetConfiguration ( Configuration::Preset  preset,
const Parameters parameters,
StringView  configurationName = StringView() 
)

Add a configuration with a given name, started by cloning options of a specific Preset.

◆ getConfiguration() [1/2]

Configuration * SC::Build::Project::getConfiguration ( StringView  configurationName)

Get Configuration with the matching configurationName

◆ getConfiguration() [2/2]

const Configuration * SC::Build::Project::getConfiguration ( StringView  configurationName) const

Get Configuration with the matching configurationName

◆ removeFiles()

bool SC::Build::Project::removeFiles ( StringView  subdirectory,
StringView  filter 
)

Remove files matching the given filter.

Useful to remove only a specific file type after Project::addDirectory

Parameters
subdirectoryThe subdirectory to search files into, absolute or relative to project root. No * allowed.
filterThe suffix filter that is appended to subdirectory (can contain *)

◆ setRootDirectory()

bool SC::Build::Project::setRootDirectory ( StringView  file)

Set root directory for this project (all relative paths will be relative to this one)

◆ validate()

Result SC::Build::Project::validate ( ) const

Validates this project for it to contain a valid combination of flags.

Member Data Documentation

◆ compile

CompileFlags SC::Build::Project::compile

Shared CompileFlags for all files in the project.

◆ configurations

Vector<Configuration> SC::Build::Project::configurations

Build configurations created inside the project.

◆ files

Vector<File> SC::Build::Project::files

Files that belong to the project.

◆ iconPath

String SC::Build::Project::iconPath

Icon location.

◆ link

LinkFlags SC::Build::Project::link

Shared LinkFlags for all files in the project.

◆ name

String SC::Build::Project::name

Project name.

◆ rootDirectory

String SC::Build::Project::rootDirectory

Project root directory.

◆ targetName

String SC::Build::Project::targetName

Project target name.

◆ targetType

TargetType::Type SC::Build::Project::targetType = TargetType::Executable

Type of build artifact.


The documentation for this struct was generated from the following file: