Sane C++ Libraries
C++ Platform Abstraction Libraries
Loading...
Searching...
No Matches
SC::Build::Project Struct Reference

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

#include <Build.h>

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)
 
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.
 
ConfigurationgetConfiguration (StringView configurationName)
 Get Configuration with the matching configurationName
 
const ConfigurationgetConfiguration (StringView configurationName) const
 Get Configuration with the matching configurationName
 
bool addFiles (StringView subdirectory, StringView filter)
 Add all source or header/inline files from a subdirectory (relative to project root) matching the given filter.
 
bool addFile (StringView singleFile)
 Add a single source or header/inline file to the project, relative to project root.
 
bool addSpecificFileFlags (SourceFiles selection)
 Add a set of flags that apply to some files only.
 
bool addIncludePaths (Span< const StringView > includePaths)
 Adds paths to include paths list.
 
bool addLinkLibraryPaths (Span< const StringView > libraryPaths)
 Adds paths to libraries paths list.
 
bool addLinkLibraries (Span< const StringView > linkLibraries)
 Adds libraries to be linked.
 
bool addLinkFrameworks (Span< const StringView > frameworks)
 Add frameworks shared with all apple os.
 
bool addLinkFrameworksMacOS (Span< const StringView > frameworks)
 Add frameworks only for macOS.
 
bool addLinkFrameworksIOS (Span< const StringView > frameworks)
 Add frameworks only for iOS.
 
bool addDefines (Span< const StringView > defines)
 Adds some pre-processor defines.
 
bool removeFiles (StringView subdirectory, StringView filter)
 Remove files matching a filter, to remove only a specific file type after Project::addDirectory.
 
Result validate () const
 Validates this project for it to contain a valid combination of flags.
 

Public Attributes

TargetType::Type targetType = TargetType::ConsoleExecutable
 Type of build artifact.
 
String name
 Project name.
 
String rootDirectory
 Project root directory.
 
String targetName
 Project target name.
 
String iconPath
 Icon location.
 
SourceFiles files
 Project source files with their associated compile flags.
 
LinkFlags link
 Linker flags applied to all files in the project.
 
Vector< SourceFilesfilesWithSpecificFlags
 List of files with specific flags different from project/config.
 
Vector< Configurationconfigurations
 Build configurations created inside the project.
 

Detailed Description

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

Member Function Documentation

◆ addDefines()

bool SC::Build::Project::addDefines ( Span< const StringView > defines)
nodiscard

Adds some pre-processor defines.

◆ addFile()

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

Add a single source or header/inline file to the project, relative to project root.

◆ addFiles()

bool SC::Build::Project::addFiles ( StringView subdirectory,
StringView filter )
nodiscard

Add all source or header/inline files from a subdirectory (relative to project root) matching the 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 *)
Note
Files with header or inline extension (.h, .hpp, .inl) will be considered non-source files.

◆ addIncludePaths()

bool SC::Build::Project::addIncludePaths ( Span< const StringView > includePaths)
nodiscard

Adds paths to include paths list.

◆ addLinkFrameworks()

bool SC::Build::Project::addLinkFrameworks ( Span< const StringView > frameworks)
nodiscard

Add frameworks shared with all apple os.

◆ addLinkFrameworksIOS()

bool SC::Build::Project::addLinkFrameworksIOS ( Span< const StringView > frameworks)
nodiscard

Add frameworks only for iOS.

◆ addLinkFrameworksMacOS()

bool SC::Build::Project::addLinkFrameworksMacOS ( Span< const StringView > frameworks)
nodiscard

Add frameworks only for macOS.

◆ addLinkLibraries()

bool SC::Build::Project::addLinkLibraries ( Span< const StringView > linkLibraries)
nodiscard

Adds libraries to be linked.

◆ addLinkLibraryPaths()

bool SC::Build::Project::addLinkLibraryPaths ( Span< const StringView > libraryPaths)
nodiscard

Adds paths to libraries paths list.

◆ addPresetConfiguration()

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

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

◆ addSpecificFileFlags()

bool SC::Build::Project::addSpecificFileFlags ( SourceFiles selection)
nodiscard

Add a set of flags that apply to some files only.

◆ getConfiguration() [1/2]

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

Get Configuration with the matching configurationName

◆ getConfiguration() [2/2]

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

Get Configuration with the matching configurationName

◆ removeFiles()

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

Remove files matching a filter, 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)
nodiscard

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

◆ validate()

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

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

Member Data Documentation

◆ configurations

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

Build configurations created inside the project.

◆ files

SourceFiles SC::Build::Project::files

Project source files with their associated compile flags.

◆ filesWithSpecificFlags

Vector<SourceFiles> SC::Build::Project::filesWithSpecificFlags

List of files with specific flags different from project/config.

◆ iconPath

String SC::Build::Project::iconPath

Icon location.

◆ link

LinkFlags SC::Build::Project::link

Linker flags applied to 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::ConsoleExecutable

Type of build artifact.


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