saker.msvc Documentation TaskDoc JavaDoc Packages
  1. saker.msvc
  2. C/C++ compilation
  3. Option presets

Option presets

Option presets are predefined configurations that can be applied to compiler and linker tasks. They are provided by the saker.msvc.coptions.preset() task and they can be applied to the CompilerOptions parameter for C compilation and LinkerOptions parameter for linking.

The purpose of presets is to ease common configurations instead of requiring the developer to manually configure the cl.exe and link.exe arguments.

An example that uses the preset for creating a dynamic link library:

$ccompile = saker.msvc.ccompile(
	src/**/*.cpp,
	CompilerOptions: [
		saker.msvc.coptions.preset(dll),
	]
)
$procclink = saker.msvc.clink(
	$ccompile,
	LinkerOptions: [
		saker.msvc.coptions.preset(dll),
	]
)

The preset with the name dll can be used to get a preset configuration that when applied to the compilation and linker tasks will produce a DLL output.

The use of presets are optional, and the tasks may be configured the same way to the full extent without them.