I am compiling everything with Cmake, first compiling the whole C++ source into one .so file, then calling setup.py and compiling the cython wrappers.
However, for some reason, every time I modify the C++ source, I have to recompile the Cython wrappers also to get the changes.
My guess is that this means I'm doing something wrong and the whole C++ code is recompiled into cywrappers.so but I am not sure why.
Basically I want to be able to compile selectively the C++ source (the cproject.so) or the cywrappers.so depending on which source files I changed.
mod_name = '@PY_NAME@'
extensions = Extension(
mod_name + ".cywrappers",
sources = ['@PYMODULE_DIR@/' + mod_name + '/cywrappers.pyx'],
language = "c++",
include_dirs = [
'@PROJECT_SOURCE_DIR@',
'@PYMODULE_DIR@/' + mod_name,
np.get_include()
],
extra_compile_args = [],
extra_link_args = [],
libraries = ['cproject'],
library_dirs = ['@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@'],
runtime_library_dirs = ['@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@']
)