Strategies for finding binary dependencies
at main 32 lines 659 B view raw
1#include <pybind11/pybind11.h> 2#include <ft2build.h> 3#include FT_FREETYPE_H 4 5int add(int a, int b) { 6 return a + b; 7} 8 9int get_freetype_version() { 10 int ft_amajor; 11 int ft_aminor; 12 int ft_apatch; 13 FT_Library library; 14 15 int error = FT_Init_FreeType(&library); 16 FT_Library_Version(library, &ft_amajor, &ft_aminor, &ft_apatch); 17 18 return ft_amajor; 19} 20 21namespace py = pybind11; 22 23PYBIND11_MODULE(_core, m) { 24 m.doc() = "python wheel test"; 25 26 m.def("add", &add, R"pbdoc( 27 A function that adds 28 )pbdoc"); 29 m.def("get_freetype_version", &get_freetype_version, R"pbdoc( 30 A function that gets the major FreeType version 31 )pbdoc"); 32}