[build2] [bug] Compilation error not visible in the reported file (wrong file reported?)

Klaim - Joël Lamotte mjklaim at gmail.com
Fri Mar 23 17:54:33 UTC 2018


On 21 March 2018 at 15:56, Boris Kolpackov <boris at codesynthesis.com> wrote:

> Klaim - Joėl Lamotte <mjklaim at gmail.com> writes:
>
> > By the way, it seems that just not using litteral strings should work?
> > They can be replaced by normal strings and escaping I believe. If that's
> > the source of the issue, I can do that modification.
>
> Yes, though this case is exactly where you really want to use raw string
> literals. Using normal literals with escaping here will get pretty hairy.
>
>
Indeed.



>
> > Or changing some compiler flags? I don't understand how CMake manage to
> > generate a compiler invocation that seem to build correctly.
>
> The source file can be compiled, just not preprocessed (which is a bug
> in VC). CMake doesn't do separate preprocessing while build2 does. You
> can read more about the reasons here:
>
> https://build2.org/faq.xhtml#ninja
>
>
I see, thanks for the clarification.



> Ok, now about the workaround (which will require the latest staged
> toolchain, BTW):
>
> [...]
>
> As a result, you probably want to limit this only to translation
> units that actual need it and also only for problematic compilers.
> Something along these lines:
>
> if ($cxx.id == 'msvc')
>   obj{foo bar}: cc.reprocess = true
>
>
Thanks. I tried this but failed to get the right names/expression where
"foo bar" is
so just to make sure this works as expected I just used obj{*} for now and
it works, all the current project compiles.
Yay. I'll continue from this. :)

How it looks like: https://github.com/Klaim/build2-pkg-chaiscript
The fork of ChaiScript with that build2-specific workaraound:
https://github.com/Klaim/ChaiScript/tree/klaim/build2

As to why obj{my_target} fails, I have no idea. I tried with all the
targets but I do not see the define passed to the compiler.

Thanks for your help.

A. Joël Lamotte
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.build2.org/archives/users/attachments/20180323/51beb509/attachment.html>


More information about the users mailing list