Repository navigation
Expand file tree
/
Copy pathREADME.md.jinja
More file actions
38 lines (29 loc) · 2.06 KB
/
Copy pathREADME.md.jinja
File metadata and controls
38 lines (29 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# {{ project_name }}
{{ project_description }}
[](https://github.com/{{ github }}/{{ project_name_formatted }}/actions/workflows/build.yaml)
[](https://codecov.io/gh/{{ github }}/{{ project_name_formatted }})
[](https://github.com/{{ github }}/{{ project_name_formatted }})
[](https://pypi.python.org/pypi/{{ project_name_formatted }})
## Overview
{%- if add_c_abi %}
## C ABI
`cpp/{{ project_name_formatted }}` builds `lib{{ module }}`, a C ABI over the C++ code, declared in
`{{ module }}/include/{{ module }}/{{ module }}.h`. Wheels ship the library under `{{ module }}/lib` and
the header under `{{ module }}/include/{{ module }}`, and the pybind11 extension in `cpp/python` links
against the library. The tests compile a C program against the installed package. Other
projects build against the installed wheel with `{{ module }}.get_include()`,
`get_library_dirs()`, `get_libraries()`, and `get_prefix()`.
`HATCH_CPP_LIBRARY_SOURCE` chooses where the library comes from at build time:
`bundled` (the default, for wheels), `external` (a prebuilt library found
through `HATCH_CPP_LIBRARY_ROOT`, pkg-config, or the conda prefix), or `direct`
(compile the library sources into the extension).
`cpp/CMakeLists.txt` builds and installs the library without Python, with a CMake
package config and a pkg-config file, for conda, vcpkg, and system packages:
```bash
cmake -S cpp -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
cmake --install build --prefix /path/to/prefix
```
{%- endif %}
> [!NOTE]
> This library was generated using [copier](https://copier.readthedocs.io/en/stable/) from the [Base Python Project Template repository](https://github.com/python-project-templates/base).