From 9be833c83409f33f49b53e0389ee13c98f259522 Mon Sep 17 00:00:00 2001 From: Timothy Patrick Burke Date: Mon, 7 Oct 2024 14:29:35 -0600 Subject: [PATCH] Fixes stub generation when pybind11-stuben fails --- python/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index 15f347d7..6ed3411d 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -156,8 +156,8 @@ if(ACEtk.python) # If the stubs fail to generate then this command exits gracefully and allows the build to continue. add_custom_command( TARGET ACEtk.python POST_BUILD - COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${tools_PYTHONPATH}:${ACEtk_PYTHONPATH}:$ENV{PYTHONPATH} ${pybind11stubgen_exe} ACEtk -o ${CMAKE_CURRENT_SOURCE_DIR}/stubs &> ${CMAKE_CURRENT_BINARY_DIR}/pybind11-stubgen.log || echo "" - COMMAND ${CMAKE_COMMAND} -E rename ${stubdir}/__init__.pyi ${stubdir}/ACEtk.pyi + COMMAND ${CMAKE_COMMAND} -E env PYTHONPATH=${tools_PYTHONPATH}:${ACEtk_PYTHONPATH}:$ENV{PYTHONPATH} ${pybind11stubgen_exe} ACEtk -o ${CMAKE_CURRENT_SOURCE_DIR}/stubs &> ${CMAKE_CURRENT_BINARY_DIR}/pybind11-stubgen.log || true + COMMAND ${CMAKE_COMMAND} -E rename ${stubdir}/__init__.pyi ${stubdir}/ACEtk.pyi &> /dev/null || true COMMAND ${CMAKE_COMMAND} -E copy_directory ${stubdir}/ ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Building ACEtk's python stub files via pybind11-stubgen. See pybind11-stubgen.log for details." VERBATIM