[PyQt] Platforms directive or tags, or both?

Phil Thompson phil at riverbankcomputing.com
Thu Oct 18 17:03:41 BST 2012


On Thu, 18 Oct 2012 09:42:30 -0600, Larry Shaffer <larrys at dakotacarto.com>
wrote:
> Hi,
> 
> I'm working on a fix for Mac (for QGIS project) where size_t needs a
> different typedef in a sip file than other platforms.
> 
> See: http://hub.qgis.org/issues/6505
> 
> The build system is CMake that passes -t WS_MACX from the found PyQt4
> config on the command line. So, I wrote a simple:
> 
> %If (WS_MACX)
> typedef unsigned long size_t;
> %End
> %If (!WS_MACX)
> typedef unsigned int size_t;
> %End
> 
> When I tried to enable the platform with  %Platforms {WS_MACX} I was
> presented with an error noting it had already been defined (or
> enabled), presumably because of the existing tag. Does the Platforms
> directive need to be used if already enabling a platform via -t on the
> command line?

%Platforms defines the platform, it doesn't enable it - you just need to
use it as you have done and pass the right -t flag.

> Also, I would either like to know what the other platforms' (Win,
> Linux, etc.) tags are expected to be and whether those can be counted
> on being consistent, or whether I can just use the CMake platform
> variables to pass in known, valid tags (WIN32, UNIX, APPLE) to use in
> sip files.

Platforms (and tags) are a SIP specific thing.

> The project has to support older sip versions on some distros, so the
> benefits provided by sip 4.14 for Platforms can't be used.

Phil


More information about the PyQt mailing list