Module Extensions
Rules for building Module Extensions
Functions
py_cc_extension
load("@rules_venv//python/module_extension:defs.bzl", "py_cc_extension")
py_cc_extension(*, name, srcs, conlyopts, copts, cxxopts, data, defines, deps, dynamic_deps,
imports, includes, linkopts, local_defines, malloc, compilation_mode, abi, stripped,
**kwargs)
Define a Python C extension module.
This target is consumed just as a py_library would be.
PARAMETERS
| Name | Description | Default Value |
|---|---|---|
| name | The name of the target. | none |
| srcs | he list of C and C++ files that are processed to create the library target. These are C/C++ source and header files, either non-generated (normal source code) or generated. For more details see cc_binary.srcs | none |
| conlyopts | Add these options to the C compilation command. For more details see cc_binary.conlyopts | [] |
| copts | Add these options to the C/C++ compilation command. For more details see cc_binary.copts | [] |
| cxxopts | Add these options to the C++ compilation command. For more details see cc_binary.cxxopts | [] |
| data | List of files used by this rule at compile time and runtime. For more details see cc_binary.data | [] |
| defines | List of defines to add to the compile line of this and all dependent targets For more details see cc_binary.defines | [] |
| deps | The list of other libraries to be linked in to the binary target. For more details see cc_binary.deps | [] |
| dynamic_deps | These are other cc_shared_library dependencies the current target depends on. For more details see cc_binary.dynamic_deps | [] |
| imports | List of import directories to be added to the PYTHONPATH. For more details see py_library.imports. | [] |
| includes | List of include dirs to be added to the compile line. For more details see cc_binary.includes | [] |
| linkopts | Add these flags to the C++ linker command. For more details see cc_binary.linkopts | [] |
| local_defines | List of defines to add to the compile line. For more details see cc_binary.local_defines | None |
| malloc | Override the default dependency on malloc. For more details see cc_binary.malloc | None |
| compilation_mode | The compilation_mode value to build the extension for. If set to "current", the current configuration will be used. | "opt" |
| abi | The ABI value to use for the output library name. | select({"@platforms//os:linux": "gnu", "//conditions:default": ""}) |
| stripped | Use the stripped output of the c extension for the library. | None |
| kwargs | Additional keyword arguments for common definition attributes. | none |