axmolengine / axmol

Axmol Engine – A Multi-platform Engine for Desktop, XBOX (UWP) and Mobile games. (A fork of Cocos2d-x-4.0)
https://axmol.dev
MIT License
922 stars 205 forks source link

C++ 20 compile support #886

Closed crazyhappygame closed 2 years ago

crazyhappygame commented 2 years ago

Is your feature request related to a problem? Please describe. Do you plan to switch to C++20 by default? C++ 20 is fully support on all platforms. C++ 20 will make engine more attractive for new technology nerds.

Describe the solution you'd like C++ by default in all GitHub actions

Describe alternatives you've considered None

Additional context None

aismann commented 2 years ago

I think it will come (after the 1.0 release) see also: #602 #87

crazyhappygame commented 2 years ago

@aismann thank you! When 1.0 release is planned?

halx99 commented 2 years ago

I have test cmake -B build -DCXX_STD=20 on windows with vs 2022, the build works.

aismann commented 2 years ago

@halx99 Should axmol switch to c++ 20 with 1.0 or later?

halx99 commented 2 years ago

Maybe we can switch

aismann commented 2 years ago

Maybe we can switch

Do it 👍 Big feature for 1.0

halx99 commented 2 years ago

Or maybe wait c++23, the c++20 still have some feature not implementd, such as the at, operator[] of map,set containers still doesn't support heterogeneous lookup.

aismann commented 2 years ago

I think we can use what exist. Not what will come C++20 is realy a big feature. axmol should not use all new features in time. But user can use the c++ 20 features on own projects.

aismann commented 2 years ago

We can add this lines for C++ (Windows) on readme.md cmake -B build_C++20 -DCXX_STD=20 -G "Visual Studio 17 2022" -A Win32 cmake -B build_C++20 -DCXX_STD=20 -G "Visual Studio 17 2022" -A x64

It's not realy a hard work to get this feature (supporting C++17/20 fully)

Tested C++20 on Winsdows 11 VS2022 64bit (Debug): (cmake -B build_C++20 -DCXX_STD=20 -G "Visual Studio 17 2022" -A x64)

All works (out of the box):

I will switch to C++20 and using axmol with this settings.

aismann commented 2 years ago

@halx99 Please add support for all other OS (Im not cmake guru)

crazyhappygame commented 2 years ago

Agree. If we switch to C++20 we should do this for all platforms.

aismann commented 2 years ago

Agree. If we switch to C++20 we should do this for all platforms.

Of course. Neverone goes alone if there a solution for all ;)

halx99 commented 2 years ago

Agree. If we switch to C++20 we should do this for all platforms.

let's github ci help us to check it

aismann commented 2 years ago

@halx99 Is it possible to change the color of cpp20? Its Look Like bug ;)

aismann commented 2 years ago

@halx99 Please adapt the description of axmol too: ... C++17/20....

halx99 commented 2 years ago

@halx99 Is it possible to change the color of cpp20? Its Look Like bug ;)

done

aismann commented 2 years ago

@halx99 I think it can be closed. All steps on the way or done.

halx99 commented 2 years ago

But other platforms not check yet

aismann commented 2 years ago

OK. And the axmol description hast only c++17 as text

halx99 commented 2 years ago

I create a PR #890 to help us check cpp20 compilings at all platforms

aismann commented 2 years ago

I create a PR #890 to help us check cpp20 compilings at all platforms

It it works this line on readme can be adapt and maybe closing this issue too. C++ 17/20 (C++20 VS2022 64bit Windows 11 tested) to C++ 17/20

crazyhappygame commented 2 years ago

It looks like only windows compiled for c++20. Please check https://github.com/axmolengine/axmol/pull/890

aismann commented 2 years ago

It looks like only windows compiled for c++20. Please check #890

It's known. Thanks.

aismann commented 2 years ago

@halx99 Good work!