From 6e0468109cc155c863b5f2afe91096414ccd99f9 Mon Sep 17 00:00:00 2001 From: Jonathan Hollocombe Date: Tue, 6 Feb 2024 08:29:10 +0000 Subject: [PATCH] Only include capnp pyuda files when capnp is enabled. --- source/wrappers/python/CMakeLists.txt | 10 +++++++--- source/wrappers/python/setup.py.in | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/wrappers/python/CMakeLists.txt b/source/wrappers/python/CMakeLists.txt index 192074b6..2e427cb6 100755 --- a/source/wrappers/python/CMakeLists.txt +++ b/source/wrappers/python/CMakeLists.txt @@ -1,6 +1,4 @@ -file( GLOB CYTHON_FILES - pyuda/cpyuda/capnp.pxd - pyuda/cpyuda/capnp_tree.pyx +set( CYTHON_FILES pyuda/cpyuda/client.pyx pyuda/cpyuda/cpyuda.pyx pyuda/cpyuda/dim.pyx @@ -12,6 +10,12 @@ file( GLOB CYTHON_FILES pyuda/cpyuda/types.pyx pyuda/cpyuda/uda.pxd ) +set( CYTHON_SOURCES pyuda/cpyuda/cpyuda.pyx ) + +if( ENABLE_CAPNP ) + list( APPEND CYTHON_FILES pyuda/cpyuda/capnp.pxd pyuda/cpyuda/capnp_tree.pyx ) + list( APPEND CYTHON_SOURCES pyuda/cpyuda/capnp_tree.pyx ) +endif( ) install( FILES ${CYTHON_FILES} DESTINATION python_installer/pyuda/cpyuda ) diff --git a/source/wrappers/python/setup.py.in b/source/wrappers/python/setup.py.in index 886b4360..fddb9aeb 100644 --- a/source/wrappers/python/setup.py.in +++ b/source/wrappers/python/setup.py.in @@ -47,7 +47,7 @@ else: ext = Extension( 'cpyuda', - ['pyuda/cpyuda/cpyuda.pyx', 'pyuda/cpyuda/capnp_tree.pyx'], + '@CYTHON_SOURCES@'.split(';'), include_dirs=list(filter(None, [ '/usr/include/tirpc', '@TIRPC_PYUDA_INCLUDE_DIR@',