craftr.ext.compiler.msvc

craftr.ext.compiler.msvc.detect(program)

Detects the version of the MSVC compiler from the specified program name and returns a dictionary with information that can be passed to the constructor of MsvcCompiler or raises ToolDetectionError.

This function also supports detecting the Clang-CL compiler.

class craftr.ext.compiler.msvc.MsvcCompiler(program='cl', language='c', desc=None, **kwargs)

Interface for the MSVC compiler.

compile(sources, frameworks=(), target_name=None, meta=None, **kwargs)

Supported options:

  • include
  • defines
  • language
  • debug
  • warn
  • optimize
  • exceptions
  • autodeps
  • description
  • program
  • additional_flags
  • msvc_additional_flags
  • msvc_compile_additional_flags

Unsupported options supported by other compilers:

  • std
  • pedantic
  • pic
  • osx_fwpath
  • osx_frameworks

Target meta variables: none

name = 'msvc'
class craftr.ext.compiler.msvc.MsvcLinker(program='link', **kwargs)

Interface for the MSVC linker.

Supported options:

  • libpath
  • libs
  • msvc_libs
  • external_libs
  • msvc_external_libs
  • debug
  • description
  • program
  • additional_flags
  • msvc_additional_flags
  • msvc_link_additional_flags

Target meta variables:

  • link_output – The output filename of the link operation.
name = 'msvc:link'
class craftr.ext.compiler.msvc.MsvcAr(program='lib', **kwargs)

Interface for the MSVC lib tool.

name = 'msvc:lib'
staticlib(output, inputs, export=(), frameworks=(), target_name=None, meta=None, **kwargs)

Supported options:

  • program
  • additional_flags
  • msvc_additional_flags
  • msvc_staticlib_additional_flags
  • description

Target meta variables:

  • staticlib_output – The output filename of the library operation.
craftr.ext.compiler.msvc.Compiler

alias of MsvcCompiler

craftr.ext.compiler.msvc.Linker

alias of MsvcLinker

craftr.ext.compiler.msvc.Archiver

alias of MsvcAr