@imp/rules/c

Module: @imp/rules/c.

DEFAULT_CPP_HDRS

Documentation is not yet available for this implementation export.

Source: rules/c/index.luau:55.

DEFAULT_CPP_SRCS

Documentation is not yet available for this implementation export.

Source: rules/c/index.luau:54.

cc_binary(options)

Declare a raw C/C++ binary. The options are those of cc_library without shared, plus linkopts: extra linker flags for the link step of this binary. The transitive_linkopts of the dependencies are added.

Returns a frozen table with BUILD, PACKAGE, and RUN slots. The product is one executable file, or a directory with the executable and each transitive shared library.

Source: rules/c/index.luau:529.

cc_library(options)

Declare a raw C/C++ library.

Options: path Workspace-relative directory. The default is the directory of the calling BUILD module. srcs Source globs. The default is DEFAULT_CPP_SRCS. hdrs Header globs, which are inputs only. The default is DEFAULT_CPP_HDRS. generated_srcs codegen() results or { artifact, path } tables. deps cc_library results, or values with the same fields. toolchain A provider or a cc_toolchain_for_platform union. The default is the declared zig, then gcc, default. copts Extra compiler flags. output_name Portable filename stem of the output. The default is the directory slug. unsafe_system_paths Skip the Bootlin path guard, to link against host system packages. Zig has no such guard. shared Build a shared library (lib<name>.so, or <name>.dll with an import library <name>.lib on Windows) in place of a static archive.

Returns a frozen table with BUILD and PACKAGE slots and archive, transitive_archives, transitive_shared_libs, transitive_import_libs, transitive_include_dirs, transitive_hdrs, and transitive_linkopts.

Source: rules/c/index.luau:493.

cc_test(options)

Declare a raw C/C++ test binary: a cc_binary whose exit code is the result of the test. The options are those of cc_binary.

The binary runs without arguments and without other mounts, so put the assertions in main(). The result is one unit for each executable, as for a CTest entry or a Rust test binary.

Returns a frozen table with BUILD, RUN, and TEST slots.

Source: rules/c/index.luau:549.

cc_workload_specs()

Return a copy of the list of declared target specs.

Source: rules/c/index.luau:176.