-
Notifications
You must be signed in to change notification settings - Fork 2
Compiler File Definition
To keep this module simple, it wont provide any compiler discovery mechanism when generating fastbuild projects. This topic is too broad and would only be helpful for a handful of people.
Because of this you need to provide the compiler definitions yourself and inform the module about these definitions.
Each compiler file needs only to provide one FastBuild structure named in a certain way.
The structure name needs to start with the 'platform' prefix followed by the system
architecture
and toolset
it's going to be used for, everything joined with a underscore character.
So in the end we get the following structure template .platform_{system}_{architecture}_{toolset}
.
Note: The 'platform' prefix does not refer to a premake 'platform', because the later is just a configuration construct.
The {system}
refers to premake5's system
function, which defines the system for which a particular configuration will be compiled, and the {architecture}
should be the same value used for premake5's architecture
function, same applies to the {toolset}
value.
Both functions need to be set in your premake5 configuration explicitly to make sure this module can find a valid compiler for each configuration. (either globally or for each configuration)
The defined structure needs to have 6 key-value pairs defined:
- For compilation:
.Compiler
and.CompilerOptions
, required are at least input and output arguments for object lists. - For linking executables:
.Linker
and.LinkerOptions
required are at least input and output arguments for executables or dlls. - For linking libraries:
.Librarian
and.LibrarianOptions
required are at least input and output arguments for libraries.
Note: An example file for a vs2017'like compilator can be found here.
If you are targeting Windows for both 32 and 64 bit (with the vs2017 toolset) you should provide two files with structures named platform_windows_x86_v141
and platform_windows_x86_64_v141
.
and define in your main premake5.lua file these values
system "windows"
architecture "x86_64"
toolset "v141"