[QBS] Does qbs plan to support cross-compiling?

Loaden loaden at gmail.com
Fri Jun 22 10:55:21 CEST 2012


toolchain=*mingw* can solved my problem.
e.g.
$HOME/.config/Nokia/qbs/platforms/mingw32/setup.ini

> [General]
> toolchain=mingw
> architecture=x86
> endianness=little-endian
> targetOS=windows
>
> [cpp]
> toolchainPrefix=i686-w64-mingw32-
> toolchainInstallPath=/usr/bin
>
> $HOME/.config/Nokia/qbs/platforms/mingw64/setup.ini

> [General]
> toolchain=mingw
> architecture=x64
> endianness=little-endian
> targetOS=windows
>
> [cpp]
> toolchainPrefix=x86_64-w64-mingw32-
> toolchainInstallPath=/usr/bin
>

Usage:
qbs platform:mingw32
or:
qbs platform:mingw64

Works perfect!


loaden at qpsoft:~/qpSOFT/Projects/Qbs/tests/manual/hello$ qbs platform:mingw32
> Found project file
> /home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/hello.qbp
> loading project took:  72 ms
> build graph took:  9 ms
> for windows-x86-qt5-debug:
>   - [hpp, application] HelloWorld as windows-x86-qt5-debug
>
> compiling foo.cpp
> compiling main.cpp
> linking HelloWorld.exe
> Build done.
> loaden at qpsoft:~/qpSOFT/Projects/Qbs/tests/manual/hello$ qbs
> platform:mingw32 run
> Found project file
> /home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/hello.qbp
> for windows-x86-qt5-debug:
>   - [hpp, application] HelloWorld as windows-x86-qt5-debug
>
> Build done.
> Starting target
> '/home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/build/windows-x86-qt5-debug/HelloWorld.exe'.
> Hello World! (debug version)
> loaden at qpsoft:~/qpSOFT/Projects/Qbs/tests/manual/hello$ qbs
> platform:mingw64 run
> Found project file
> /home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/hello.qbp
> loading project took:  36 ms
> build graph took:  6 ms
> for windows-x64-qt5-debug:
>   - [hpp, application] HelloWorld as windows-x64-qt5-debug
>
> compiling foo.cpp
> compiling main.cpp
> linking HelloWorld.exe
> Build done.
> Starting target
> '/home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/build/windows-x64-qt5-debug/HelloWorld.exe'.
> Hello World! (debug version)
> loaden at qpsoft:~/qpSOFT/Projects/Qbs/tests/manual/hello$
>

2012/6/22 Loaden <loaden at gmail.com>

> No luck! It's not work for me.
>
> [General]
>> toolchain=*mingw64*
>> architecture=x86_64
>>
>> endianness=little-endian
>> targetOS=windows
>>
>> [cpp]
>> toolchainPrefix=x86_64-w64-mingw32-
>> toolchainInstallPath=/usr/bin
>>
> ERROR:
>
>> ERROR: /home/loaden/qpSOFT/Projects/Qbs/tests/manual/hello/hello.qbp:17
>> Binding 'cpp.defines' failed, no property 'cpp' in the scope of Group
>>
>  Any comments?
>
> 2012/5/11 Joerg Bornemann <joerg.bornemann at nokia.com>
>
>> On 11/05/2012 14:45, ext Loaden wrote:
>>
>>  As we know there not have a good way to support cross-compiling, e.g. In
>>> Ubuntu, If we want use MinGW to build qt apps for Windows?
>>> So, Does qbs plan to support cross-compiling?
>>>
>>
>> Qbs already supports cross-compiling. Set up the platform you want to
>> build for and build your project with
>>   qbs platform:myPlatform
>>
>> For example, my platform config for 32 bit MinGW on Linux looks like this:
>>
>> ----
>> [General]
>> toolchain=mingw
>> architecture=x86
>> endianness=little-endian
>> targetOS=windows
>>
>> [cpp]
>> toolchainPrefix=x86_64-w64-**mingw32-
>> toolchainInstallPath=/usr/bin
>> ----
>>
>>
>> BR,
>>
>> Jörg
>>
>
>
>
> --
> Please don't ask where I come from, It's a shame!
> Best Regards
> Yuchen
>
>


-- 
Please don't ask where I come from, It's a shame!
Best Regards
Yuchen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/qbs/attachments/20120622/5eb8fcd6/attachment.html>


More information about the Qbs mailing list