pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: USE_CXX_FEATURES



Patrick Welche <prlw1%welche.eu@localhost> writes:

> On Thu, Sep 21, 2023 at 11:33:47AM +0200, Paolo Vincenzo Olivo wrote:
>> > but we still need a
>> > 
>> >   USE_LANGUAGES=	c++17
>> > to actually apply the -std=c++17 flag so it get used?
>> 
>> If the package doesn't append `-std=c++17' to CFLAGS on its own, but
>> requires it... yes this will allow it to build.
>> However, forcing a specific C/C++ standard through USE_LANGUAGES is
>> now deprecated in pkgsrc (and will likely become unsupported in future).
>> The proper way to do this in pkgsrc-trunk is:
>> 
>> FORCE_CXX_STD=  c++17
>
> Thanks! The reason libpqxx doesn't append -stdc++17 is that it will
> happily use c++20 features if one used -stdc++20 instead, so leaves
> it up to the user to apply the appropriate flag for the compiler.
> Here we might as well stick to the minimum 17 requirement as per
> your fix.

That's broken of libpqxx then.  It is ok to probe for the compiler
accepting 20 and set/use that, and if not set/use 17, or to set/use 17
unless the user gives --enable-c++20.  (It's not clear to me if there
are ABI issues resulting from building some things with 17 and some with
20.)  So setting this is a workaround for a broken package.



Home | Main Index | Thread Index | Old Index