We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f4b9347 commit 9e8f4d2Copy full SHA for 9e8f4d2
src/CMakeLists.txt
@@ -0,0 +1,15 @@
1
+cmake_minimum_required(VERSION 3.15...3.26)
2
+project(
3
+ "${SKBUILD_PROJECT_NAME}"
4
+ LANGUAGES CXX
5
+ VERSION "${SKBUILD_PROJECT_VERSION}")
6
+
7
+find_package(Python COMPONENTS Interpreter Development.Module REQUIRED)
8
+find_package(pybind11 CONFIG REQUIRED)
9
10
+pybind11_add_module(_calc_mod MODULE calcmod.cpp)
11
12
+target_compile_definitions(_calc_mod
13
+ PRIVATE VERSION_INFO=${PROJECT_VERSION})
14
15
+install(TARGETS _calc_mod DESTINATION metpy)
src/calcmod.cpp
@@ -0,0 +1,10 @@
+#include <pybind11/pybind11.h>
+int add(int i, int j) {
+ return i + j;
+}
+PYBIND11_MODULE(_calc_mod, m) {
+ m.doc() = "accelerator module docstring";
+ m.def("add", &add, "Add two numbers");
0 commit comments