[QBS] setting windowsApiCharacterSet

Kurt Keller kk at parity-software.com
Mon Oct 28 10:59:00 CET 2013


Am Montag, den 28.10.2013
schrieb 罗勇刚(Yonggang Luo)  <luoyonggang at gmail.com>:

> That's weird, may be this is the cause of that:
> 
>     windowsApiCharacterSet: "unicode"
>     platformDefines:
> base.concat(Windows.characterSetDefines(windowsApiCharacterSet))
> 
> 
> I dond't know if this
>  base.concat(Windows.characterSetDefines(windowsApiCharacterSet)) will be
> running multiple times, if there is only one time, then there won't be
> problems.
> Try to clean and re-run again.

You are right! This is called 3 times. (Proved: by doing a print() inside
Windows.characterSetDefines())
I guess: one call for initialising qbs itself, another for the
Depends{ name: 'cpp' } in the Application { ... } block and the 3rd call
for the Depends { name: 'cpp' } in the module 'myModule'.

It does not help to clean and re-run again unfortunately. This looks like
a bug to me.

> 
> 
> 2013/10/28 Kurt Keller <kk at parity-software.com>
> 
> > Am Montag, den 28.10.2013
> > schrieb 罗勇刚(Yonggang Luo)  <luoyonggang at gmail.com>:
> >
> > Thank you for your answer.
> >
> > > \section2 windowsApiCharacterSet
> > >
> > >     \table
> > >     \row    \li \b{Type:}            \li \c{string}
> > >     \row    \li \b{Allowed Values:}  \li \c{"unicode"}, \c{"mbcs"},
> > > \c{undefined}
> > >     \row    \li \b{Default:}         \li \c{"unicode"}
> > >     \endtable
> >
> > I found this in the 1.0.1 docs:
> >   Type: string
> >   Allowed Values: "unicode", "mbcs", undefined
> >   Default: "unicode"
> > Is there a newer documentation around?
> >
> > >
> > > use "mbcs" instead.
> > >
> >
> > Using "mbcs" instead leads to the compiler call:
> >
> >   cl.exe ....  /D_MBCS /DUNICODE /D_UNICODE ...
> >
> > and does not suppress /DUNICODE.
> >
> > >
> > > 2013/10/28 Kurt Keller <kk at parity-software.com>
> > >
> > > > Hi all,
> > > >
> > > > when I have a simple project (which only depends on the 'cpp'
> > > > module) I can set windowsApiCharacterSet:undefined to get rid of
> > > > the /DUNICODE and /D_UNICODE defines on windows.
> > > >
> > > > But this does not work if there is an additional dependency to a
> > > > other module, which depends itself on 'cpp':
> > > >
> > > > ------------------- main.qbs
> > > > import qbs 1.0
> > > > Application {
> > > >   ...
> > > >   Depends { name: 'cpp' }
> > > >   Depends { name: 'myModule' }
> > > >
> > > >   cpp.windowsApiCharacterSet: undefined
> > > >   ...
> > > > }
> > > >
> > > > ------------------- myModule.qbs
> > > > import qbs 1.0
> > > > Module {
> > > >   Depends { name: 'cpp' }
> > > >   ... // no further references to windowsApiCharacterSet here
> > > > }
> > > >
> > > > In this example qbs generates compiler calls with \D_UNICODE and
> > > > \DUNICODE set. I can stop this only by inserting
> > > >
> > > >   myModule.cpp.windowsApiCharacterSet: undefined
> > > >
> > > > into the Application { ... } block.
> > > >
> > > > What am I missing? Imho this is very impractical, because the
> > > > writer of the main QBS File must know the internals of myModule to
> > > > specify compiler flags correctly.
> > > >
> > > > Is there a method to undefine or to unset compiler defines
> > > > globally?
> > > >
> > > >
> > > > --
> > > > Best regards
> > > > Kurt Keller
> > > > _______________________________________________
> > > > QBS mailing list
> > > > QBS at qt-project.org
> > > > http://lists.qt-project.org/mailman/listinfo/qbs
> > > >
> > >
> > >
> > >
> >
> 



More information about the Qbs mailing list