Skip to content

Commit

Permalink
Only generate stubs on linux (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
CCInc authored Sep 13, 2022
1 parent 36f6d36 commit 794a512
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@ set_target_properties(${COPC_PYTHON_LIB} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/copclib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/copclib)

add_custom_command(TARGET ${COPC_PYTHON_LIB} POST_BUILD
COMMAND stubgen -m _core -o .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/copclib
COMMENT "Generating stubs for pybind"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/copclib/_core.pyi DESTINATION .)
if(UNIX AND NOT APPLE)
add_custom_command(TARGET ${COPC_PYTHON_LIB} POST_BUILD
COMMAND stubgen -m _core -o .
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/copclib
COMMENT "Generating stubs for pybind"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/copclib/_core.pyi DESTINATION .)
endif()

if(WITH_TESTS)
include(DownloadExampleFiles)
Expand Down

0 comments on commit 794a512

Please sign in to comment.