Contact | License

# VSSolution

Summary

Generates a Solution file for use with Visual Studio, allowing integration of FASTBuild into Visual Studio.

VSSolution( 'alias' ) // (optional) Alias { // Basic options .SolutionOutput // Path to Solution file to be generated .SolutionProjects // (optional) Project(s) to include in Solution .SolutionConfigs // (optional) Solution configurations (see below) // Folders .SolutionFolders // (optional) Folders to organize projects (see below) // Advanced options .SolutionDependencies // (optional) Project dependency information (see below) // Version Info .SolutionVisualStudioVersion // (optional) Version of Solution (default "14.0.22823.1" VS2015 RC) .SolutionMinimumVisualStudioVersion // (optional) Min version of Solution (default "10.0.40219.1" VS2010 Express) // Additional configuration options - see below } // SolutionConfigs - structs in the following format //--------------------------------------------------- [ .Platform // Platform(s) (default "Win32", "x64") .Config // Config(s) (default "Debug", "Release") .SolutionConfig // (optional) Solution Config .SolutionPlatform // (optional) Solution Platform // Additional configuration options - see below ] // SolutionFolders - structs in the following format //--------------------------------------------------- [ .Path // Folder path in Solution .Projects // (optional) Project(s) to include in this folder .Items // (optional) Solution Item(s) (files) to include in this folder ] // SolutionDependencies - structs in the following format //------------------------------------------------------- [ .Projects // Project(s) to specify dependencies for .Dependencies // Project(s) the above projects depend on ] // Additional Configuration options //--------------------------------- .SolutionBuildProject // (optional) Project(s) set to build when "Build Solution" is selected .SolutionDeployProjects // (optional) Project(s) set deploy
Details

VSSolution generates a Visual Studio Solution file, referencing Projects generated with VCXProject. It supports organizing the Projects within folders in the Solution. Solutions are compatible with VS 2010 and later.

Basic Options

.SolutionOutput - String - (Required)

The output location of the .sln file.

Example:
.SolutionOutput = 'tmp/VisualStudio/MySolution.sln'

.SolutionProjects - String or ArrayOfStrings - (Optional)

The previously defined VCXProject item(s) to include in the solution. Projects will be placed at the root of the Solution, unless a .Folders entry specifies otherwise (see below). Projects which are placed in Solution Folders do not need to be listed in .SolutionProjects.

Example:
.SolutionProjects = { 'LibraryA-proj' // Previously defined with VCXProject 'LibraryB-proj' // Previously defined with VCXProject 'Exe-proj' // Previously defined with VCXProject }

.SolutionConfigs - Array of SolutionConfig Structure(s) - (Optional)

The platform/configuration pairs you wish to appear in Visual Studio can be controlled here. They need to match those specified in your generated projects.

Example:
.Solution_Config_Debug = [ .Platform = 'Win32' .Config = 'Debug' ] .Solution_Config_Release = [ .Platform = 'Win32' .Config = 'Release' ] .SolutionConfigs = { .Solution_Config_Debug, .Solution_Config_Release }

If not specified, a default matrix of Win32|Debug, Win32|Release, x64|Debug and x64|Release configurations is used.

The optional .SolutionConfig and .SolutionPlatform allow custom solution level Configs and Platforms to be defined. This can be useful when the Config/Platform from the Solution and Project don't have a 1:1 relationship.

Example:
.DebugDirectX = [ .Config = 'Debug-DirectX' .Platform = 'Win32' .SolutionConfig = 'Debug' .SolutionPlatform = 'Win32-DirectX' ] .DebugOpenGL = [ .Config = 'Debug-OpenGL' .Platform = 'Win32' .SolutionConfig = 'Debug' .SolutionPlatform = 'Win32-OpenGL' ]
Folders

.SolutionFolders - Array of SolutionFolder Structure(s) - (Optional)

Projects and solution items within a Solution can be organized into folders. Folders may contain projects and/or items, or can be empty.

Example:
.FolderA = [ .Path = 'Libraries' .Projects = { 'LibraryA-proj', 'LibraryB-proj' } .Items = { 'rel_path_to/item_file_1.txt', 'rel_path_to/item_file_2.ext' } ] .FolderB = [ .Path = 'Executables' .Projects = { 'Exe-proj' } ] .SolutionFolders = { .FolderA, .FolderB }

Projects not associated with folders will appear at the root of the the Solution.

Advanced

.SolutionDependencies - Array of SolutionDependency Structure(s) - (Optional)

Projects within a Solution can be specified as depending on other projects within the Solution.

For simple solutions, this option is typically not necessary.

For more complex Solutions, specifying artificial SolutionDependencies may be useful (depending on the desired F5 behaviour). For example, in Solutions with multiple executables, only one of the executables should be listed as a .SolutionBuildProject (to prevent multiple concurrent invocations of FASTBuild). However, (because of what is arguably a bug in Visual Studio) only when this project (the "primary" project) is the active project, will F5 trigger an up-to-date build check on the target automatically before running. If you want this automatic check on other targets (rather than having to manually build the Project or Solution), you have to artificially make any "non-primary" projects depend on the "primary" executable.

Example:
.Deps = [ .Projects = { 'Exe1-proj', 'Exe2-proj' } // F5 with either as the active project will perform a Solution Build (via "All") .Dependencies = { 'All-proj' } ] .SolutionDependencies = { .Deps }
Version Info

.SolutionVisualStudioVersion - String - (Optional)

Specify the VisualStudio version that you would like to appear as the generator of this Solution file.

Example:
.SolutionVisualStudioVersion = "14.0.22823.1"

If not specified, "14.0.22823.1" will be used (VS2015 RC).

.SolutionMinimumVisualStudioVersion - String - (Optional)

Specify the minimum VisualStudio version necessary to open this Solution file.

Example:
.SolutionMinimumVisualStudioVersion = "10.0.40219.1"

If not specified, "10.0.40219.1" will be used (VS2010 Express).

Additional Configuration Options

Various options can be specified at either the Solution or SolutionConfig level. Options defined at the SolutionConfig level will override those set at the Solution level.

SolutionBuildProject - String or ArrayOfStrings - (Optional)

Projects which will build when solution is built. Generally, only one project should be specified.

Example:
.SolutionBuildProjects = 'Project' // A previously defined vcxproject

SolutionDeployProjects - String or ArrayOfStrings - (Optional)

Projects in the solution to be deployed.

Example:
.SolutionDeployProjects = 'Project' // A previously defined vcxproject