sip-build using C compiler for .cpp files when not using pyqt-builder?

Patrick Stinson patrickkidd at gmail.com
Sat Oct 8 15:12:03 BST 2022


Ah roger that. I was stepping through the sipbuild's calls in setuptools
but assumed it wouldn't pull in env vars.

Luckily the lib source I am compiling in my extension is simple enough that
I could just replace the c++11/c++14 stuff with older counterparts so I am
all good. But interesting to know that clang defaults to an old spec and
that it can prevent extensions to build unless using some c++ specific
flags var like CPPFLAGS.

On Sat, Oct 8, 2022 at 6:09 AM Phil Thompson <phil at riverbankcomputing.com>
wrote:

> According to the setuptools docs setting the CPPFLAGS environment
> variable might work.
>
> Phil
>
> On 08/10/2022 14:49, Patrick Stinson wrote:
> > So then with:
> >
> > extra-compile-args = ["-std=c++11"]
> >
> > you get this for the .c files:
> >
> > error: invalid argument '-std=c++11' not allowed with 'C'
> >
> > On Sat, Oct 8, 2022 at 5:47 AM Patrick Stinson <patrickkidd at gmail.com>
> > wrote:
> >
> >> Yeah, ok. It compiles fine on ubuntu. I think this is actually a
> >> problem
> >> in the default c++ spec for clang 14.0.0 on macos 12.6, for example
> >> these
> >> warnings and errors:
> >>
> >> warning: scoped enumerations are a C++11 extension
> >> [-Wc++11-extensions]
> >> error: unknown type name 'constexpr'
> >>
> >> On Fri, Oct 7, 2022 at 12:25 AM Phil Thompson
> >> <phil at riverbankcomputing.com>
> >> wrote:
> >>
> >>> On 06/10/2022 19:25, Patrick Stinson wrote:
> >>> > I have a pure C++ sip extension and it looks like sip-build is using
> >>> > the C
> >>> > compiler for everything. My other extension that sues pyqt-builder
> >>> > seems to
> >>> > work. Is there a way to get sip to use the c++ compiler for cpp files
> >>> > while
> >>> > also correctly compiling sip's C files like sip_array.c etc?
> >>> >
> >>> > Using sip-6.7.1.
> >>> >
> >>> > Cheers,
> >>> > -Patrick
> >>>
> >>> By default (ie. when you are not using PyQt-builder) SIP will use
> >>> setuptools to do the build. It will call the correct compiler
> >>> depending
> >>> on the filename extension. Works fine for me.
> >>>
> >>> Phil
> >>>
> >>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20221008/a2dd493b/attachment-0001.htm>


More information about the PyQt mailing list