c++2a

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

c++2a

Angel Campoverde
Hello,

I am looking at:

https://cmake.org/cmake/help/v3.14/prop_tgt/CXX_STANDARD.html

and I see that I can pass 20, for c++20. However I do not have that in my compiler, I only have c++2a and gnu++2a, this means that CMake goes back to c++17 and macros like __VA_OPT__:

https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

can't  be used. I know that all this should work, because I can compile myself a small test piece of code with:

g++ code.cxx -o code -std=c++2a

so the problems is CMake. Is there a way to go around this?

Cheers.

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Mateusz Loskot
On Tue, 7 May 2019 at 01:15, Angel Campoverde
<[hidden email]> wrote:
>
> I am looking at:
>
> https://cmake.org/cmake/help/v3.14/prop_tgt/CXX_STANDARD.html
>
> and I see that I can pass 20, for c++20. However I do not have that in my compiler,
> I only have c++2a and gnu++2a, this means that CMake goes back to c++17

No, it doesn't mean that.

The valid values documented for CXX_STANDARD are CMake generalisation
and not what is directly passed via -std= or /std: or whatever option
your compiler uses.

If you run this cmake command
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF ..
and then
VERBOSE=1 make
you will clearly see that CMake generated the compiler
command lines with -std=c++2a

IFF, you are using version of GCC or clang that supports c++2a, obviously
(i.e. GCC 8/clang 6 or later. I'm not entirely confident about clang)

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Angel Campoverde
Hi,

No, It does not work, I told Cmake to use c++ 20, but it still goes back to c++17. You can see what I get here:


my CMakeLists.txt is here:


do you know what could be the problem?

Cheers.

On Tue, May 7, 2019 at 2:33 AM Mateusz Loskot <[hidden email]> wrote:
On Tue, 7 May 2019 at 01:15, Angel Campoverde
<[hidden email]> wrote:
>
> I am looking at:
>
> https://cmake.org/cmake/help/v3.14/prop_tgt/CXX_STANDARD.html
>
> and I see that I can pass 20, for c++20. However I do not have that in my compiler,
> I only have c++2a and gnu++2a, this means that CMake goes back to c++17

No, it doesn't mean that.

The valid values documented for CXX_STANDARD are CMake generalisation
and not what is directly passed via -std= or /std: or whatever option
your compiler uses.

If you run this cmake command
cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF ..
and then
VERBOSE=1 make
you will clearly see that CMake generated the compiler
command lines with -std=c++2a

IFF, you are using version of GCC or clang that supports c++2a, obviously
(i.e. GCC 8/clang 6 or later. I'm not entirely confident about clang)

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

CMake mailing list
CMake hasn't been updated to be aware that XCode 10 added support for
C++20 (via -std=c++2a). I have opened a MR to correct this which you
can track at: https://gitlab.kitware.com/cmake/cmake/merge_requests/3294

On Tue, May 7, 2019 at 12:24 PM Angel Campoverde
<[hidden email]> wrote:

>
> Hi,
>
> No, It does not work, I told Cmake to use c++ 20, but it still goes back to c++17. You can see what I get here:
>
> https://pastebin.com/5ub18cMU
>
> my CMakeLists.txt is here:
>
> https://pastebin.com/3bwMKrWB
>
> do you know what could be the problem?
>
> Cheers.
>
> On Tue, May 7, 2019 at 2:33 AM Mateusz Loskot <[hidden email]> wrote:
>>
>> On Tue, 7 May 2019 at 01:15, Angel Campoverde
>> <[hidden email]> wrote:
>> >
>> > I am looking at:
>> >
>> > https://cmake.org/cmake/help/v3.14/prop_tgt/CXX_STANDARD.html
>> >
>> > and I see that I can pass 20, for c++20. However I do not have that in my compiler,
>> > I only have c++2a and gnu++2a, this means that CMake goes back to c++17
>>
>> No, it doesn't mean that.
>>
>> The valid values documented for CXX_STANDARD are CMake generalisation
>> and not what is directly passed via -std= or /std: or whatever option
>> your compiler uses.
>>
>> If you run this cmake command
>> cmake -DCMAKE_CXX_STANDARD=20 -DCMAKE_CXX_EXTENSIONS=OFF ..
>> and then
>> VERBOSE=1 make
>> you will clearly see that CMake generated the compiler
>> command lines with -std=c++2a
>>
>> IFF, you are using version of GCC or clang that supports c++2a, obviously
>> (i.e. GCC 8/clang 6 or later. I'm not entirely confident about clang)
>>
>> Best regards,
>> --
>> Mateusz Loskot, http://mateusz.loskot.net
>> --
>>
>> Powered by www.kitware.com
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>>
>> CMake Support: http://cmake.org/cmake/help/support.html
>> CMake Consulting: http://cmake.org/cmake/help/consulting.html
>> CMake Training Courses: http://cmake.org/cmake/help/training.html
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Follow this link to subscribe/unsubscribe:
>> https://cmake.org/mailman/listinfo/cmake
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Mateusz Loskot
In reply to this post by Angel Campoverde
On Tue, 7 May 2019 at 18:24, Angel Campoverde
<[hidden email]> wrote:
>
> No, It does not work, I told Cmake to use c++ 20, but it still goes back to c++17. You can see what I get here:
>
> https://pastebin.com/5ub18cMU

Next time, please specify what compiler you are using.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Angel Campoverde
Next time please ask what computer I am using.

On Tue, May 7, 2019 at 1:04 PM Mateusz Loskot <[hidden email]> wrote:
On Tue, 7 May 2019 at 18:24, Angel Campoverde
<[hidden email]> wrote:
>
> No, It does not work, I told Cmake to use c++ 20, but it still goes back to c++17. You can see what I get here:
>
> https://pastebin.com/5ub18cMU

Next time, please specify what compiler you are using.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Mateusz Loskot
On Tue, 7 May 2019 at 20:38, Angel Campoverde
<[hidden email]> wrote:
> Next time please ask what computer I am using.

CMake results are intrinsically compiler-specific.
Your issue is compiler-specific.

Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net

p.s. Please, stop it.
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
--
Mateusz Loskot
http://mateusz.loskot.net
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Stefan Fendt
In reply to this post by Angel Campoverde
Am 07.05.2019 um 20:37 schrieb Angel Campoverde:
> Next time please ask what computer I am using.

*What*? Really? *Please* give this a second thought...

Stefan

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
Hex
Reply | Threaded
Open this post in threaded view
|

Re: c++2a

Hex
ummh, sooo... h, do you like... cheese?

On 5/9/19 7:21 AM, Stefan Fendt wrote:
> Am 07.05.2019 um 20:37 schrieb Angel Campoverde:
>> Next time please ask what computer I am using.
> *What*? Really? *Please* give this a second thought...
>
> Stefan
>
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake