@imp/rules/c/msvc
Module: @imp/rules/c/msvc.
MSVC_GRAPH_TOOL_NAMES
Documentation is not yet available for this implementation export.
Source: rules/c/msvc/index.luau:51.
NASM
Documentation is not yet available for this implementation export.
Source: rules/c/msvc/index.luau:46.
is_msvc_toolchain(toolchain_value)
True when toolchain is an MSVC provider.
Source: rules/c/msvc/index.luau:453.
msvc_cmake_compiler_args(host, nasm_path)
The CMake arguments that select a discovered MSVC host: the compiler, RC, MT, and NASM paths. CMake selects lib.exe and its MSVC archive rule from cl.exe. The Ninja generator does not find rc and mt itself.
CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ON gives the default of GNU ld, which exports each global symbol. MSVC exports nothing without dllexport or a .def file, and then writes no import library. C and C++ dependencies built for gcc usually have no dllexport annotations.
Source: rules/c/msvc/index.luau:285.
msvc_env(host)
The action environment of a discovered host.
PATH has the MSVC and Windows SDK bin directories, so that cl.exe,
link.exe, lib.exe, rc.exe, and mt.exe run where the host installed them.
Imp adds the bin directories of the declared tools before this PATH.
INCLUDE and LIB are the variables that vcvarsall.bat sets. They are not
/I and /LIBPATH flags, because a CMake replay runs each edge through
sh -c, and the replay removes the double quotes of a command, which
breaks a path such as "Program Files (x86)". An environment value is not
tokenized.
MSYS2_ARG_CONV_EXCL=* stops the MSYS runtime of Git for Windows from
changing a token that looks like a POSIX path before it starts a native
program. Without it, a flag such as /FoCMakeFiles/foo.dir/x.obj changes,
and cl.exe writes the object to the wrong path.
Source: rules/c/msvc/index.luau:267.
msvc_host_dirs(host)
The MSVC and Windows SDK directories of a discovered host, for x86_64
(Hostx64/x64) only: { bin_dir, sdk_bin_dir, include_dirs, lib_dirs }.
Source: rules/c/msvc/index.luau:234.
msvc_toolchain()
The MSVC provider of the shared C toolchain contract. It has no version:
it uses the Visual Studio that the host has. The table is inert. Only a
task that declares task_inputs() runs the discovery task.
Source: rules/c/msvc/index.luau:414.
nasm_artifact_name(version, plat)
The NASM release archive filename for a version and platform.
Source: rules/c/msvc/index.luau:69.
nasm_cache_key(version)
The named-cache key for a NASM version. The JavaScript module uses one fixed key. A Luau named cache is shared and Imp does not write an existing slot again, so the key must identify the version.
Source: rules/c/msvc/index.luau:84.
nasm_download_url(version, plat)
The NASM release download URL for a version and platform.
Source: rules/c/msvc/index.luau:77.
nasm_graph_tool(version)
The NASM tool handle of a version, of the default, or of the pinned version.
Source: rules/c/msvc/index.luau:158.
nasm_supported_platforms()
The platforms that NASM publishes release archives for.
Source: rules/c/msvc/index.luau:64.
nasm_toolchain(version, options)
Declare a NASM version. An MSVC CMake configure uses the default.
Options: default Make this version the default. unverified Download without a lockfile entry, with a warning. lockfile Address of a lockfile to use instead of the shipped one, for example "@workspace/locks/nasm.lock".
Returns { version, lockfile, [GEN_LOCKFILES] }. Export the value from a
BUILD module to make its lockfile root selectable by
imp goal gen-lockfiles.
Source: rules/c/msvc/index.luau:179.
parse_msvc_host(stdout)
Parse the four lines that the discovery script prints into the host
record { vs_root, msc_version, sdk_root, sdk_version }.
Source: rules/c/msvc/index.luau:318.
reset_for_test()
Forget the discovery task, each declared NASM version, and the default. Tests call this, because the module declares a default when it loads on Windows.
Source: rules/c/msvc/index.luau:460.
resolve_nasm_host(exec, nasm_tool)
The absolute host path of nasm.exe. Call it in a task body. nasm_tool
is a NASM tool handle, declared as a task input.
Source: rules/c/msvc/index.luau:207.