coin3d / pivy

python bindings to coin3d
ISC License
53 stars 37 forks source link

Unable to specify additional include flags #63

Closed kkremitzki closed 3 years ago

kkremitzki commented 4 years ago

David Daish created an issue 2019-03-05

While building Pivy, I needed to be able to specify additional include flags for Swig, but the setup script offered no way to do this. Instead, I had to overwrite the setup script with the required additions.

Specifically, all Swig based builds failed without these flags. -I/usr/include/boost/compatibility/cpp_c_headers -I/usr/include/x86_64-linux-gnu/c++/6/ -I/usr/include/c++/6

To resolve this issue, I recommend adding a command line option for adding additional flags to calls to Swig.

Comments (3)

    Florian Franzen

    I am dealing with this issue too, and it all has to do with the use of swig's -includeall flag (excerpt from the manual):

        It should be noted that your mileage will vary greatly here. System headers are notoriously complicated and may rely upon a variety of non-standard C coding extensions (e.g., such as special directives to GCC). Unless you exactly specify the right include directories and preprocessor symbols, this may not work correctly (you will have to experiment). 

    The project even comes with the required headers in the fake_headers subdirectory but then fails to use them by including standard headers under their C++ name everywhere (e.g. cassert instead of assert.h).

    Currently I would therefore recommend to just drop the current setup.py implementation and to replace it by a scikit-build and CMake based alternative.
        2019-03-06
    Florian Franzen

    Here is how FreeCAD solved the issue.
        2019-03-06
    David Daish reporter

    Interesting. I agree that the setup.py implementation needs a bit of a rewrite. I'm not familiar with this sciki-build system. Seems like a very reasonable way to go. setuputils is notoriously poorly documented.
looooo commented 3 years ago

Please check the cmake-configuration.