Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
MAminSFV committed Sep 12, 2024
1 parent 6afc062 commit 613a5c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ set(CMAKE_POSITION_INDEPENDENT_CODE ON)

# Add a library using FindPython's tooling (pybind11 also provides a helper like
# this)
python_add_library(drake_extension_ext MODULE src/drake_extension_ext.cpp WITH_SOABI)
target_link_libraries(drake_extension_ext PUBLIC pybind11::headers drake::drake)
pybind11_add_module(drake_extension_ext MODULE src/drake_extension_ext.cpp)
target_link_libraries(drake_extension_ext PUBLIC drake::drake)
set_target_properties(drake_extension_ext PROPERTIES CXX_VISIBILITY_PRESET default)

# This is passing in the version as a define just as an example
Expand Down
2 changes: 2 additions & 0 deletions src/drake_extension_ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class SimpleAdder : public LeafSystem<T> {
PYBIND11_MODULE(drake_extension_ext , m) {
m.doc() = "Example module interfacing with pydrake and Drake C++";

py::module::import("pydrake.systems.framework");

using T = double;

py::class_<SimpleAdder<T>, LeafSystem<T>>(m, "SimpleAdder")
Expand Down

0 comments on commit 613a5c9

Please sign in to comment.