Re: [Qbs] Unexpected behavior of MSVC generator

2019-02-16 Thread Richard Weickelt
Denis,

> > What’s the point of implementing a rule for cpp files directly in the 
> solution and not implementing it for other cases? I don’t see any use cases.
> 
> I'm don't understand a bit, what do you mean here?

I think your view on the build process is too narrow. If all you care about is
the conversion of C/C++ sources to object files to application binary, then it
could make sense to produce native build files for your favorite IDE. This is
all what proprietary IDEs with their little proprietary "build automation
system" like IAR are usually capable of. But as soon as you want to

- integrate custom tools in your build process, for instance code generators
  (you mentioned already Qt moc)
- build additional assests, like documentation
- combine libraries and applications in a single build
- parameterize parts of your project

it becomes painful. Even for IAR users, additional code generators are not
uncommon. The IAR IDE gives you the option to define one pre-build, one post-
build action and ONE additional rule for a SINGLE tool. That might be
sufficient in some simple cases, but as soon as you want to do more, you have
to work around the IDE, for instance by invoking an external build tool.

With the assumption that such cases are very common, it doesn't make sense to
generate native build files at all. It is then often better and easier to let
Qbs run the build process. I guess, this is what Ivan wanted to tell you.

> UPD: I'm ask all this question, because I'm doubt: is it makes sense 
> tries to implement the generators (to spent a time) for a "bare-metal" 
> stuff... e.g. to generate the projects for IAR, Keil, Atmel Studio and 
> etc? Or QBS is dead, and we need to make tries to use CMake for that 
> cases (but I'm don't know and don't like CMake)? It is a main dilemma! :)

If you are using IAR then you probably appreciate the performant debugger and
its ability to debug even highly optimized code. You are probably also used to
IAR's editor and you can't live without it. Fair enough, but for that you
don't need its native build tool, really. All you need is a project file
generator that sets correct source files, defines, include paths and the
application binary file path so that the IDE can understand it, invokes the
debugger correctly and resolves code locations while debugging.

I think the same applies to the other IDEs you mentioned. Whether it makes
sense to implement a project file generator is a different question. It could
make sense if you are bound to one of those IDEs, but you want to build
projects of higher complexity than what they can handle.

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


Re: [Qbs] Unexpected behavior of MSVC generator

2019-02-16 Thread Иван Комиссаров

> 16 февр. 2019 г., в 19:04, Denis Shienkov  
> написал(а):
> 
> Why is it a very challenging task?
> 
> It is enough just to parse the QBS project, to take a compiler flags, 
> architectures,
> defines and so on, and to create the MSVC project using that info. And then 
> the 
> Visual Studio will invoke all required stuff 'as usual' using own resources.
> 

For c++ - yes. Imagine a pure javascript rule that doesn’t invoke any 
«compiler» (like cl or javac) but converts some input to output using qbs 
itself. How that custom rule would like?

> 
> Yes, of course, generating of the Qt-based project will cause some 
> difficulties
> (due to MOC and etc)... But for non-qt projects it should work. 
> 
> PS: Besides, the Qt MSVC addon and the CMake solves it anyway... Why QBS 
> can't? :)
> 

It can. But when choosing 2 ways of doing same thing, you write down pros and 
cons and compare those ways. The cons are - it’s harder to implement the proper 
generator than the fake one (simply because «proper generator» will include the 
«fake» one for the case I mentioned above). What are pros?
> 
> > What’s the point of implementing a rule for cpp files directly in the 
> > solution and not implementing it for other cases? I don’t see any use cases.
> 
> I'm don't understand a bit, what do you mean here?
> 
What I am trying to tell is that current approach may not be perfect, but it 
works. Unless you can say what’s wrong with it. You need to describe what’s 
wrong and prove that it can’t be fixed due to the chosen approach. For now 
you’re just saying that QBS behaves different from CMake. Well, this is not a 
new information=))

> UPD: I'm ask all this question, because I'm doubt: is it makes sense tries to 
> implement the generators (to spent a time) for a "bare-metal" stuff... e.g. 
> to generate the projects for IAR, Keil, Atmel Studio and etc? Or QBS is dead, 
> and we need to make tries to use CMake for that cases (but I'm don't know and 
> don't like CMake)? It is a main dilemma! :)
> 

It’s open source now. If personally you need this feature, contribute it.

> BR, 
> 
> Denis
> 
> 
> 
> 16.02.2019 20:14, Иван Комиссаров пишет:
>> I can comment. If you want a real generator, you should use cmake=)
>> 
>> Being serious, it is not a recursion, it is a proxy - solution is the proxy 
>> for the IDE to call the build tool (which is QBS).
>> Creating a «proper» solution that invokes compilers directly is a very 
>> challenging task… Imagine you have a custom (not the *.cpp -> *.o) rule for 
>> generating some files with a bunch of JS code. How are you going to invoke 
>> this code? Well, you probably would like to call QBS… But if you’re calling 
>> it for *some* cases why not call it in *all* cases and save some time?
>> 
>> What’s the point of implementing a rule for cpp files directly in the 
>> solution and not implementing it for other cases? I don’t see any use cases.
>> 
>>> 16 февр. 2019 г., в 16:10, Denis Shienkov  
>>>  написал(а):
>>> 
>>> Hi all,
>>> 
>>> It was surprised for me, that a generated MSVC solution file has
>>> a build commands which are calls the QBS to build the generated
>>> MSVC solution... It is recursion!!! o_O
>>> 
>>> WTF? But it has not a sense!
>>> 
>>> If I want to build a project using the QBS, then I know that I
>>> will use the QBS!
>>> 
>>> But when I want to generate the MSVC project, then I will expect
>>> that the QBS will generate the 'native' MSVC solution, which I
>>> will use in the Visual Studio IDE on a host without of the QBS!
>>> 
>>> Any comments?
>>> 
>>> BR,
>>> Denis
>>> 
>>> ___
>>> 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] Unexpected behavior of MSVC generator

2019-02-16 Thread Иван Комиссаров
I can comment. If you want a real generator, you should use cmake=)

Being serious, it is not a recursion, it is a proxy - solution is the proxy for 
the IDE to call the build tool (which is QBS).
Creating a «proper» solution that invokes compilers directly is a very 
challenging task… Imagine you have a custom (not the *.cpp -> *.o) rule for 
generating some files with a bunch of JS code. How are you going to invoke this 
code? Well, you probably would like to call QBS… But if you’re calling it for 
*some* cases why not call it in *all* cases and save some time?

What’s the point of implementing a rule for cpp files directly in the solution 
and not implementing it for other cases? I don’t see any use cases.

> 16 февр. 2019 г., в 16:10, Denis Shienkov  
> написал(а):
> 
> Hi all,
> 
> It was surprised for me, that a generated MSVC solution file has
> a build commands which are calls the QBS to build the generated
> MSVC solution... It is recursion!!! o_O
> 
> WTF? But it has not a sense!
> 
> If I want to build a project using the QBS, then I know that I
> will use the QBS!
> 
> But when I want to generate the MSVC project, then I will expect
> that the QBS will generate the 'native' MSVC solution, which I
> will use in the Visual Studio IDE on a host without of the QBS!
> 
> Any comments?
> 
> BR,
> Denis
> 
> ___
> 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] Unexpected behavior of MSVC generator

2019-02-16 Thread Denis Shienkov

Hi all,

It was surprised for me, that a generated MSVC solution file has
a build commands which are calls the QBS to build the generated
MSVC solution... It is recursion!!! o_O

WTF? But it has not a sense!

If I want to build a project using the QBS, then I know that I
will use the QBS!

But when I want to generate the MSVC project, then I will expect
that the QBS will generate the 'native' MSVC solution, which I
will use in the Visual Studio IDE on a host without of the QBS!

Any comments?

BR,
Denis

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