diff --git a/.github/workflows/macos-linux-conda.yml b/.github/workflows/macos-linux-conda.yml index 8c8a6cf9c4..62c10cb5fa 100644 --- a/.github/workflows/macos-linux-conda.yml +++ b/.github/workflows/macos-linux-conda.yml @@ -89,6 +89,7 @@ jobs: -DPYTHON_EXECUTABLE=$(which python3) \ -DBUILD_WITH_OPENMP_SUPPORT=ON \ -DINSTALL_DOCUMENTATION=ON \ + -DGENERATE_PYTHON_STUBS=ON \ -DOpenMP_ROOT=$CONDA_PREFIX cmake --build . -j2 ctest --output-on-failure diff --git a/.github/workflows/windows-conda.yml b/.github/workflows/windows-conda.yml index 1593abfd71..69df377b03 100644 --- a/.github/workflows/windows-conda.yml +++ b/.github/workflows/windows-conda.yml @@ -86,6 +86,7 @@ jobs: -DBUILD_WITH_COLLISION_SUPPORT=ON ^ -DBUILD_TESTING=ON ^ -DINSTALL_DOCUMENTATION=ON ^ + -DGENERATE_PYTHON_STUBS=ON ^ .. :: Build diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a24aba06b..a7aecabfc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Remove a lot of warnings ([#2139](https://github.com/stack-of-tasks/pinocchio/pull/2139)) - `MeshcatVisualizer` doesn't crash anymore when there is no collision model defined ([#2147](https://github.com/stack-of-tasks/pinocchio/pull/2147)) - Fix MSVC build ([#2155](https://github.com/stack-of-tasks/pinocchio/pull/2155)) +- Fix stub generation ([#2166](https://github.com/stack-of-tasks/pinocchio/pull/2166)) ### Added - Add `examples/floating-base-velocity-viewer.py` to visualize floating base velocity [#2143](https://github.com/stack-of-tasks/pinocchio/pull/2143) diff --git a/bindings/python/CMakeLists.txt b/bindings/python/CMakeLists.txt index 4c37b0c789..6e2eeeae1c 100644 --- a/bindings/python/CMakeLists.txt +++ b/bindings/python/CMakeLists.txt @@ -91,7 +91,11 @@ IF(BUILD_PYTHON_INTERFACE) if(GENERATE_PYTHON_STUBS) include("${CMAKE_SOURCE_DIR}/cmake/stubs.cmake") LOAD_STUBGEN() - GENERATE_STUBS(${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_NAME} ${ABSOLUTE_PYTHON_SITELIB}) + # Set PYWRAP and PROJECT_NAME as stubs dependencies. + # PROJECT_NAME is mandatory (even if it's a PYWRAP dependency) + # to find PROJECT_NAME name DLL on windows. + GENERATE_STUBS(${CMAKE_CURRENT_BINARY_DIR} ${PROJECT_NAME} ${ABSOLUTE_PYTHON_SITELIB} + ${PYWRAP} ${PROJECT_NAME}) endif(GENERATE_PYTHON_STUBS) INSTALL(