Re: [Qbs] (no subject)

2020-07-31 Thread Jochen Ulrich
Hi!

> Is qbs supposed to work with Qt WebAssembly (I cannot get it to work)?

No, at the moment Qbs does not provide support for WebAssembly.
However, since you can do anything with Qbs, it should be possible to get it to 
work as well. __
In the end, it boils down to writing a Module that provides Rules to process 
the input files as required.
Probably, this Module should derive from the CppModule?! You can have a look at 
the internals of the CppModule here: 
https://code.qt.io/cgit/qbs/qbs.git/tree/share/qbs/modules/cpp
Unfortunately, I have no knowledge of WebAssembly so I cannot help with the 
details. :-/

> If not, are there plans to add support?

I don't think there are any plans yet. Contributions are welcome, of course. __

Best
Jochen

___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] (no subject)

2020-07-30 Thread Dan Pat
Is qbs supposed to work with Qt WebAssembly (I cannot get it to work)? If
not, are there plans to add support?
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-12-12 Thread Иван Комиссаров
https://bugreports.qt.io/browse/QBS-1522

> 29 нояб. 2019 г., в 08:03, Dan Pat  написал(а):
> 
> > Who imposes that requirement and why?
> Ok. Here's the thing. The project I am working on is based on Qt library and 
> consists of a bunch of libraries and executables with dependencies between 
> them expressed via a "Depends" language item. Plus there a number of 
> pre-built third-party libraries wrapped in Modules that some of the Products 
> within the project depend on. The project compiles and links and I can run 
> the executables just fine. Now comes Asan. We use a dynamic version of Asan, 
> since the CRT we use is dynamic (compilation with /MD option) . The first 
> step was to compile the project with sanitiser support. I managed that, but I 
> when tried to to run one of the tests, Asan reported an error. I did a bit of 
> research and figured out that the error was detected early on during 
> initialization of Qt DLLs. From what I have been able to find out from 
> Internet sources and through a  bit of testing I concluded that for the 
> sanitizer to work properly, the asan.dll must be loaded before any other DLL 
> in the process, specifically before the C runtime library, because it needs 
> to do some hotpatching in order to be able trace every heap allocation call. 
> In my case, seemingly, the asan.dll was loaded somewhere in the middle of the 
> DLL loading sequence when some of the heap allocation has already been done 
> resulting in a false error report. My research revealed that in order for the 
> asan.dll to be loaded first, its import record in the binary IAT must come 
> first, and for the import record to come first the corresponding import 
> library must come first on the linker's list of imports. The asan library is 
> contained in a Module, and I have no idea how to get its import to the 
> beginning of the linker's list. Let's consider an example Product. Looking at 
> an issued linker command:  Module dependencies are listed after any Product 
> dependencies, any libraries specified directly in cpp.dynamicLibraries (as an 
> experiment, we  normally use Depends) come before Module dependencies but 
> after any Product dependencies, any cpp,linkerFlags (tried as a last resort) 
> go the end of the linker's arguments string.  I hope I have made myself 
> clear, thank you. 
> 
> чт, 28 нояб. 2019 г. в 21:37, Иван Комиссаров  >:
> It’s worth mentioning, that compiling with verbose flag can give some insight 
> on what libraries/options clang-cl passes to the linker:
> 
> clang-cl -v -fsanitize=address main.cpp
> 
> Иван Комиссаров
> 
>> 28 нояб. 2019 г., в 17:23, Иван Комиссаров > > написал(а):
>> 
>> I did a small research and was able to compile a small example with 
>> clang-cl and asan.
>> Here are the flags I had to set manually:
>> 
>> cpp.optimization: "none"
>> cpp.cxxFlags: [
>> "/MT",
>> "-fsanitize=address",
>> ]
>> cpp.linkerFlags: [
>> 
>> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
>> 
>> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
>> ]
>> cpp.staticLibraries: [
>> 
>> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
>> 
>> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
>> ]
>> 
>> Probably, we should add some support for that in Qbs...
>> The problem is that qbs calls the linker directly (which is not the same 
>> clang-cl uses), maybe it’s worth using clang-cl for linking... or just add 
>> support for the usual clang with msvc ABI (I have plans for that for 1.16)
>> 
>> Иван Комиссаров
>> 
>>> 28 нояб. 2019 г., в 15:53, Christian Kandeler >> > написал(а):
>>> 
>>> On Thu, 28 Nov 2019 18:58:54 +0500
>>> Dan Pat mailto:danni...@gmail.com>> wrote:
>>> 
 Hello. I am trying to use Asan in my project (windows 10, clang-cl).
 There's a requirement for the Asan import library to appear first in the
 linker's list of import libraries. 
>>> 
>>> Who imposes that requirement and why?
>>> 
 I cannot seem to find a way to achieve this with qbs. Any suggestions?
>>> 
>>> If you are sure it's really, really needed, you can use a Properties item 
>>> in your product with e.g. cpp.dynamicLibraries 
>>> (https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop
>>>  
>>> ),
>>>  but then you will have to list *all* libraries there.
>>> 
>>> 
>>> Christian
>>> ___
>>> Qbs mailing list
>>> Qbs@qt-project.org 
>>> https://lists.qt-project.org/listinfo/qbs 
>>> 
> 

Re: [Qbs] (no subject)

2019-12-03 Thread Dan Pat
Ok, I'll give it a try. Thank you!

пн, 2 дек. 2019 г., 22:27 Иван Комиссаров :

> Hello, Dan!
>
> It’s very sad to hear that QtC crashes for you.
>
> There’s one known issue in qbs which will be fixed with QtC 4.11 release.
> Can you please try release candidate if it works better or not?
> https://download.qt.io/development_releases/qtcreator/4.11/4.11.0-rc1/
>
> If release candidate still crashes, it might be worth compiling QtCreator
> manually in release with debug info - in that case, you will be able to
> attach a post-mortem debugger to it and see what happens
>
> PS: I am experiencing crashes on MacOS with QtC 4.10, but they are not
> related to qbs as far as I can see from the backtrace.
>
> > 2 дек. 2019 г., в 07:55, Dan Pat  написал(а):
> >
> > Hello, my qtcreator keeps crashing during reparsing of qbs projects
> (windows 10) - like twice or thrice a day. I'd really like to provide
> something along the lines of a log or a backtrace. Does such a log exist?
> AFAIK, to get a meaningfull backtrace for release builds under windows some
> sort of a backtrace creation facility has to be used. Does qtcreator/qbs
> have one in place?
> > ___
> > Qbs mailing list
> > Qbs@qt-project.org
> > https://lists.qt-project.org/listinfo/qbs
>
>
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-12-02 Thread Иван Комиссаров
Hello, Dan!

It’s very sad to hear that QtC crashes for you.

There’s one known issue in qbs which will be fixed with QtC 4.11 release. Can 
you please try release candidate if it works better or not? 
https://download.qt.io/development_releases/qtcreator/4.11/4.11.0-rc1/

If release candidate still crashes, it might be worth compiling QtCreator 
manually in release with debug info - in that case, you will be able to attach 
a post-mortem debugger to it and see what happens

PS: I am experiencing crashes on MacOS with QtC 4.10, but they are not related 
to qbs as far as I can see from the backtrace.

> 2 дек. 2019 г., в 07:55, Dan Pat  написал(а):
> 
> Hello, my qtcreator keeps crashing during reparsing of qbs projects (windows 
> 10) - like twice or thrice a day. I'd really like to provide something along 
> the lines of a log or a backtrace. Does such a log exist? AFAIK, to get a 
> meaningfull backtrace for release builds under windows some sort of a 
> backtrace creation facility has to be used. Does qtcreator/qbs have one in 
> place?  
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs

___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] (no subject)

2019-12-01 Thread Dan Pat
Hello, my qtcreator keeps crashing during reparsing of qbs projects
(windows 10) - like twice or thrice a day. I'd really like to provide
something along the lines of a log or a backtrace. Does such a log exist?
AFAIK, to get a meaningfull backtrace for release builds under windows some
sort of a backtrace creation facility has to be used. Does qtcreator/qbs
have one in place?
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-11-28 Thread Dan Pat
 > Who imposes that requirement and why?
Ok. Here's the thing. The project I am working on is based on Qt library
and consists of a bunch of libraries and executables with dependencies
between them expressed via a "Depends" language item. Plus there a number
of pre-built third-party libraries wrapped in Modules that some of the
Products within the project depend on. The project compiles and links and I
can run the executables just fine. Now comes Asan. We use a dynamic version
of Asan, since the CRT we use is dynamic (compilation with /MD option) .
The first step was to compile the project with sanitiser support. I managed
that, but I when tried to to run one of the tests, Asan reported an error.
I did a bit of research and figured out that the error was detected early
on during initialization of Qt DLLs. From what I have been able to find out
from Internet sources and through a  bit of testing I concluded that for
the sanitizer to work properly, the asan.dll must be loaded before any
other DLL in the process, specifically before the C runtime library,
because it needs to do some hotpatching in order to be able trace every
heap allocation call. In my case, seemingly, the asan.dll was loaded
somewhere in the middle of the DLL loading sequence when some of the heap
allocation has already been done resulting in a false error report. My
research revealed that in order for the asan.dll to be loaded first, its
import record in the binary IAT must come first, and for the import record
to come first the corresponding import library must come first on the
linker's list of imports. The asan library is contained in a Module, and I
have no idea how to get its import to the beginning of the linker's list.
Let's consider an example Product. Looking at an issued linker command:
Module dependencies are listed after any Product dependencies, any
libraries specified directly in cpp.dynamicLibraries (as an experiment, we
normally use Depends) come before Module dependencies but after any Product
dependencies, any cpp,linkerFlags (tried as a last resort) go the end of
the linker's arguments string.  I hope I have made myself clear, thank you.

чт, 28 нояб. 2019 г. в 21:37, Иван Комиссаров :

> It’s worth mentioning, that compiling with verbose flag can give some
> insight on what libraries/options clang-cl passes to the linker:
>
> clang-cl -v -fsanitize=address main.cpp
>
> Иван Комиссаров
>
> 28 нояб. 2019 г., в 17:23, Иван Комиссаров  написал(а):
>
> I did a small research and was able to compile a small example with
> clang-cl and asan.
> Here are the flags I had to set manually:
>
>
> cpp.optimization: "none"
>
> cpp.cxxFlags: [
>
> "/MT",
>
> "-fsanitize=address",
>
> ]
>
> cpp.linkerFlags: [
>
>
> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
>
>
> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
>
> ]
>
> cpp.staticLibraries: [
>
>
> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
>
>
> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
>
> ]
>
> Probably, we should add some support for that in Qbs...
> The problem is that qbs calls the linker directly (which is not the same
> clang-cl uses), maybe it’s worth using clang-cl for linking... or just add
> support for the usual clang with msvc ABI (I have plans for that for 1.16)
>
> Иван Комиссаров
>
> 28 нояб. 2019 г., в 15:53, Christian Kandeler 
> написал(а):
>
> On Thu, 28 Nov 2019 18:58:54 +0500
> Dan Pat  wrote:
>
> Hello. I am trying to use Asan in my project (windows 10, clang-cl).
>
> There's a requirement for the Asan import library to appear first in the
>
> linker's list of import libraries.
>
>
> Who imposes that requirement and why?
>
> I cannot seem to find a way to achieve this with qbs. Any suggestions?
>
>
> If you are sure it's really, really needed, you can use a Properties item
> in your product with e.g. cpp.dynamicLibraries (
> https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop),
> but then you will have to list *all* libraries there.
>
>
> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs
>
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-11-28 Thread Иван Комиссаров
It’s worth mentioning, that compiling with verbose flag can give some insight 
on what libraries/options clang-cl passes to the linker:

clang-cl -v -fsanitize=address main.cpp

Иван Комиссаров

> 28 нояб. 2019 г., в 17:23, Иван Комиссаров  написал(а):
> 
> I did a small research and was able to compile a small example with clang-cl 
> and asan.
> Here are the flags I had to set manually:
> 
> cpp.optimization: "none"
> cpp.cxxFlags: [
> "/MT",
> "-fsanitize=address",
> ]
> cpp.linkerFlags: [
> 
> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
> 
> "-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
> ]
> cpp.staticLibraries: [
> 
> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",
> 
> "C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
> ]
> 
> Probably, we should add some support for that in Qbs...
> The problem is that qbs calls the linker directly (which is not the same 
> clang-cl uses), maybe it’s worth using clang-cl for linking... or just add 
> support for the usual clang with msvc ABI (I have plans for that for 1.16)
> 
> Иван Комиссаров
> 
>>> 28 нояб. 2019 г., в 15:53, Christian Kandeler  
>>> написал(а):
>>> 
>> On Thu, 28 Nov 2019 18:58:54 +0500
>> Dan Pat  wrote:
>> 
>>> Hello. I am trying to use Asan in my project (windows 10, clang-cl).
>>> There's a requirement for the Asan import library to appear first in the
>>> linker's list of import libraries. 
>> 
>> Who imposes that requirement and why?
>> 
>>> I cannot seem to find a way to achieve this with qbs. Any suggestions?
>> 
>> If you are sure it's really, really needed, you can use a Properties item in 
>> your product with e.g. cpp.dynamicLibraries 
>> (https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop),
>>  but then you will have to list *all* libraries there.
>> 
>> 
>> Christian
>> ___
>> Qbs mailing list
>> Qbs@qt-project.org
>> https://lists.qt-project.org/listinfo/qbs
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-11-28 Thread Иван Комиссаров
I did a small research and was able to compile a small example with clang-cl 
and asan.
Here are the flags I had to set manually:

cpp.optimization: "none"
cpp.cxxFlags: [
"/MT",
"-fsanitize=address",
]
cpp.linkerFlags: [

"-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",

"-wholearchive:C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
]
cpp.staticLibraries: [

"C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan-x86_64.lib",

"C:\\Developer\\LLVM\\lib\\clang\\8.0.0\\lib\\windows\\clang_rt.asan_cxx-x86_64.lib",
]

Probably, we should add some support for that in Qbs...
The problem is that qbs calls the linker directly (which is not the same 
clang-cl uses), maybe it’s worth using clang-cl for linking... or just add 
support for the usual clang with msvc ABI (I have plans for that for 1.16)

Иван Комиссаров

> 28 нояб. 2019 г., в 15:53, Christian Kandeler  
> написал(а):
> 
> On Thu, 28 Nov 2019 18:58:54 +0500
> Dan Pat  wrote:
> 
>> Hello. I am trying to use Asan in my project (windows 10, clang-cl).
>> There's a requirement for the Asan import library to appear first in the
>> linker's list of import libraries. 
> 
> Who imposes that requirement and why?
> 
>> I cannot seem to find a way to achieve this with qbs. Any suggestions?
> 
> If you are sure it's really, really needed, you can use a Properties item in 
> your product with e.g. cpp.dynamicLibraries 
> (https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop),
>  but then you will have to list *all* libraries there.
> 
> 
> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> https://lists.qt-project.org/listinfo/qbs
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2019-11-28 Thread Christian Kandeler
On Thu, 28 Nov 2019 18:58:54 +0500
Dan Pat  wrote:

> Hello. I am trying to use Asan in my project (windows 10, clang-cl).
> There's a requirement for the Asan import library to appear first in the
> linker's list of import libraries. 

Who imposes that requirement and why?

> I cannot seem to find a way to achieve this with qbs. Any suggestions?

If you are sure it's really, really needed, you can use a Properties item in 
your product with e.g. cpp.dynamicLibraries 
(https://doc.qt.io/qbs/qml-qbslanguageitems-properties.html#overrideListProperties-prop),
 but then you will have to list *all* libraries there.


Christian
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


[Qbs] (no subject)

2019-11-28 Thread Dan Pat
Hello. I am trying to use Asan in my project (windows 10, clang-cl).
There's a requirement for the Asan import library to appear first in the
linker's list of import libraries. I cannot seem to find a way to achieve
this with qbs. Any suggestions?
___
Qbs mailing list
Qbs@qt-project.org
https://lists.qt-project.org/listinfo/qbs


Re: [Qbs] (no subject)

2016-12-14 Thread Ch'Gans
On 15 December 2016 at 11:20, Ch'Gans  wrote:
> On 14 December 2016 at 22:51, Christian Kandeler
>  wrote:
>> On 12/13/2016 11:44 PM, Ch'Gans wrote:
>>> On 13 December 2016 at 10:22, Ch'Gans  wrote:
 On 13 December 2016 at 07:32, Jake Petroules  wrote:
> Also fails on MinGW :)

 So, i take that this test still passes on non-windows hosts.
 Not sure i will have some time today, which is a pity b/c i have
 Qt-5.7 on windows here, ans later at home, i only have linux and
 macos... :(
>>>
>>> Any update? Unfortunately, i don't have MCVS 2015, only 2008 and 2013 :(
>>
>> For MSVC, this was required: https://codereview.qt-project.org/#/c/179583/
>> I don't know about the mingw case.
>
> I'm not sure clang-check can understand MSVC compiler commands (clang
> itself can with 'clang.exe --driver-mode=cl' or simply using
> clang-cl.exe). I've found some discussion threads about doing this,
> but no concrete solutions. I've just send an email to the clang user
> ML, will keep updated.
>
> Is this failure a regression? Or is it a new test configuration?
>
> Simply replacing /D with -D might not be enough.
>
> maybe these 2 clang-check options could come handy:
>   -extra-arg=- Additional argument to append to the
> compiler command line
>   -extra-arg-before= - Additional argument to prepend to the
> compiler command line
>
> eg, -extra-arg-before=--driver-mode=cl, or something along these lines...

This trick does the job to get rid of clang-check complains about
'linker' input unused, and i think is way better than
https://codereview.qt-project.org/#/c/179583/

The corecrt.h issue seems to be related to MSVC2015

A quick googling around points to some weird bug about missing an
include and lib path, eg:
https://llvm.org/bugs/show_bug.cgi?id=23275
https://devtalk.nvidia.com/default/topic/969047/cuda-8-vs2015-corecrt-h-error/?offset=7

The guy's solution was to setup these env:
INCLUDE="C:\Program Files (x86)\Windows Kits\10\Include\10.0.10240.0\ucrt"
LIB="C:\Program Files (x86)\Windows
Kits\10\Lib\10.0.10240.0\um\x64;C:\Program Files (x86)\Windows
Kits\10\Lib\10.0.10240.0\ucrt\x64"

Maybe qbs-setup-toolchains needs some MSVC2015 tweaks?

Chris


>
> No clue about the mingw case, i would need to try it here...
>
> Chris
>
>>
>>
>> Christian
> ___
> Qbs mailing list
> Qbs@qt-project.org
> http://lists.qt-project.org/mailman/listinfo/qbs
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


[Qbs] (no subject)

2016-12-14 Thread Ch'Gans
On 14 December 2016 at 22:51, Christian Kandeler
 wrote:
> On 12/13/2016 11:44 PM, Ch'Gans wrote:
>> On 13 December 2016 at 10:22, Ch'Gans  wrote:
>>> On 13 December 2016 at 07:32, Jake Petroules  wrote:
 Also fails on MinGW :)
>>>
>>> So, i take that this test still passes on non-windows hosts.
>>> Not sure i will have some time today, which is a pity b/c i have
>>> Qt-5.7 on windows here, ans later at home, i only have linux and
>>> macos... :(
>>
>> Any update? Unfortunately, i don't have MCVS 2015, only 2008 and 2013 :(
>
> For MSVC, this was required: https://codereview.qt-project.org/#/c/179583/
> I don't know about the mingw case.

I'm not sure clang-check can understand MSVC compiler commands (clang
itself can with 'clang.exe --driver-mode=cl' or simply using
clang-cl.exe). I've found some discussion threads about doing this,
but no concrete solutions. I've just send an email to the clang user
ML, will keep updated.

Is this failure a regression? Or is it a new test configuration?

Simply replacing /D with -D might not be enough.

maybe these 2 clang-check options could come handy:
  -extra-arg=- Additional argument to append to the
compiler command line
  -extra-arg-before= - Additional argument to prepend to the
compiler command line

eg, -extra-arg-before=--driver-mode=cl, or something along these lines...

No clue about the mingw case, i would need to try it here...

Chris

>
>
> Christian
___
Qbs mailing list
Qbs@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] (no subject)

2013-05-16 Thread Joerg Bornemann
On 15/05/2013 18:28, Kakadu wrote:

 Now qbs take source file and generates result in  build folder. I have 
 compiler which takes source files and places result always in the same 
 folder. Is it possible to hack qbs to copy source file to build directory and 
 built it there? How difficult is it?

You'd have to add a copy command before the actual compiler call. 
Something like this:

---snip---
Rule {
 ...
 prepare: {
 ...
 var commands = [];
 // copy source file
 var cmd = new Command(cp, [input.fileName, 
FileInfo.path(output.fileName));
 commands.push(cmd);
 // now the actual compiler call
 cmd = new Command(g++, args);
 commands.push(cmd);
 return commands;
 }
}
---snap---

Instead of calling cp you can use a JavaScript command and copy the file 
via File.copy in a platform-independent way, if you want.


BR,

Joerg

___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


Re: [QBS] (no subject)

2013-05-16 Thread Kakadu
Oh, I didn't expect that prepare can return many commands. thanks.

-- 
Best wishes,
Kakadu

16.05.2013, 12:14, Joerg Bornemann joerg.bornem...@digia.com:
 On 15/05/2013 18:28, Kakadu wrote:

  Now qbs take source file and generates result in  build folder. I have 
 compiler which takes source files and places result always in the same 
 folder. Is it possible to hack qbs to copy source file to build directory 
 and built it there? How difficult is it?

 You'd have to add a copy command before the actual compiler call.
 Something like this:

 ---snip---
 Rule {
  ...
  prepare: {
  ...
  var commands = [];
  // copy source file
  var cmd = new Command(cp, [input.fileName,
 FileInfo.path(output.fileName));
  commands.push(cmd);
  // now the actual compiler call
  cmd = new Command(g++, args);
  commands.push(cmd);
  return commands;
  }
 }
 ---snap---

 Instead of calling cp you can use a JavaScript command and copy the file
 via File.copy in a platform-independent way, if you want.

 BR,

 Joerg

 ___
 QBS mailing list
 QBS@qt-project.org
 http://lists.qt-project.org/mailman/listinfo/qbs
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs


[QBS] (no subject)

2013-05-15 Thread Kakadu
Hey

Now qbs take source file and generates result in  build folder. I have compiler 
which takes source files and places result always in the same folder. Is it 
possible to hack qbs to copy source file to build directory and built it there? 
How difficult is it?

-- 
Best wishes,
Kakadu
___
QBS mailing list
QBS@qt-project.org
http://lists.qt-project.org/mailman/listinfo/qbs