[Python] Why does cmake on windows specify duplicate SWIG python language indications?

Discussão em 'Python' iniciado por Stack, Janeiro 22, 2025.

  1. Stack

    Stack Membro Participativo

    I'm successfully building a SWIG interface between python and my C++ library on Linux using cmake. (well, except on linux an extra _ is added at the beginning of the module name).

    However, on windows, the build fails with "Only one target language can be supported at a time (both -python and -python were specified)." My SWIG_ADD_LIBRARY call is straight forward:

    SWIG_ADD_LIBRARY(pyIntegration TYPE SHARED LANGUAGE PYTHON SOURCES example.i example.h, etc )

    My .i file is not very exciting, just a module specification as : %module pyIntegration

    and some typedefs (e.g. unsigned int uint32_t, etc).

    Any thoughts? Seems like a cmake bug most likely, but how best to work around? Thanks so much for any assistance!

    Continue reading...

Compartilhe esta Página