[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [External] Re: building code already generated by sip-build
From:       Phil Thompson <phil () riverbankcomputing ! com>
Date:       2023-11-17 16:08:36
Message-ID: 6319f5e7c731b37dd9fd9be05303c227 () riverbankcomputing ! com
[Download RAW message or body]

On 17/11/2023 13:29, Edward A. Pier wrote:
> Just running make was my first thought, but I don't see a Makefile (or
> equivalent for any other build system) anywhere. I only see the
> generated .cpp and .h files and the .o files in the build directory.
> Poking around the sip Python code, it seems like the compilation and
> linking are orchestrated there. In theory I could roll my own
> Makefile, but that is unappealing, giving the number of compiler
> flags.

If you are wrapping Qt code then I assumed you would be building on top 
of PyQt and using PyQt-builder rather than plain SIP. In which case you 
would get Makefiles and a --no-make option.

> Any other ideas? A different approach would be if there was a way to
> inject code into the sipAPIxxx.h file.

There a several ways (ie. directives) but they may not put the code in 
the right place for what you want.

Phil

> ________________________________
> From: Phil Thompson <phil@riverbankcomputing.com>
> Sent: Thursday, November 16, 2023 11:53 PM
> To: Edward A. Pier <epier@oceanit.com>
> Cc: pyqt@riverbankcomputing.com <pyqt@riverbankcomputing.com>
> Subject: [External] Re: building code already generated by sip-build
> 
> [You don't often get email from phil@riverbankcomputing.com. Learn why
> this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> On 16/11/2023 14:12, Edward A. Pier wrote:
>> I am using sip to wrap some Qt-related C++ code in Python. I am
>> running sip-build 6.7.12 under MSYS2 on Windows.
>> 
>> The project compilation fails with a long spew of errors coming from
>> the qmetatype.h header file which is included by sipAPIxxx.h (I
>> substituted xxx for the project name).
>> 
>> The includes at the top of that file look like this:
>> 
>> #include "sip.h"
>> 
>> #include <QMetaType>
>> #include <QThread>
>> 
>> I find that if I swap the order of the QMetaType and QThread includes,
>> it compiles.
>> 
>> While it would be nice to understand and fix the ultimate cause of
>> this problem, I would settle for a workaround where I generate the
>> code, then modify the generated code, and then compile. I see there is
>> a --no-compile option on sip-build that would handle the first thing,
>> but I don't see a way to just compile already generated code with all
>> the necessary compiler flags.
>> 
>> Thanx for your help, and let me know if you need any more info.
> 
> Just run make?
> 
> Phil
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic