Opened 3 years ago

Closed 3 years ago

#5862 closed task (fixed)

Drop Visual Studio 2015 and use C++17

Reported by: wraitii Owned by: wraitii
Priority: Release Blocker Milestone: Alpha 24
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by wraitii)

See also VS13 ticket: #5379

To compile SM68 (#5860), we need Visual Studio 2017. SM60 is compatible with both VS15 and VS17, so it's a good idea to change then.

To compile SM78 (#5861), we need C++17, which is supported in VS17 (but other compilers might have varying support). C++17 also has minor code incompatibilities with C++11.

Note that I'm unsure if SM60 and SM68 can be compiled with c++17, which means this would be a two-stepper.

TODO:

Change History (10)

comment:1 by Vladislav Belov, 3 years ago

We have compilers on other platforms too (that might not support C++17).

comment:2 by wraitii, 3 years ago

C++17 support is most likely good enough from Clang 5+, GCC 7+ and VS17+

We won't have much choice but to drop support for earlier versions.

comment:3 by Vladislav Belov, 3 years ago

It's possible to mix C++ standards (with some kind of work), but we need to decide what to drop.

Last edited 3 years ago by Vladislav Belov (previous) (diff)

comment:4 by wraitii, 3 years ago

Description: modified (diff)

comment:5 by wraitii, 3 years ago

In 24235:

Enable C++14

Spidermonkey 60 can only be compiled with C++14. This conflicts with building 0 A.D. with C++11, so upgrade to C++14 first.
This in itself should not drop compiler support on any platform.

Tested on Windows by: Stan
Tested on Linux by: Freagarach

Refs #5859
Refs #5862

Differential Revision: https://code.wildfiregames.com/D3124

comment:6 by wraitii, 3 years ago

In 24240:

Prepare for VS2017 upgrade - workspace updates

This:

  • Generates a VS solution for VS17
  • Explicits the boost toolset chosen, leveraging ABI compatibility to avoid recompiling the library (for now).
  • Likewise, reuses the Spidermonkey libraries. The SM60 upgrades does away with putting the toolset in the library name entirely.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3130

comment:7 by wraitii, 3 years ago

In 24286:

Drop support for compiling with Visual Studio 2015

Ahead of the SM68 migration, where we will need to use VS17, drop support for compiling with VS16.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3158

comment:8 by wraitii, 3 years ago

In 24301:

Remove binary_function usage.

std::binary_function was a pre-C++11 construct, that is removed entirely in c++17, and no longer necessary regardless.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3164

comment:9 by wraitii, 3 years ago

In 24302:

Update random_shuffle usage for C++17

C++14 deprecates and C++17 removes functions we use for random sounds.
This makes FastRand() fit the URG interface, and uses the appropriate function.

Refs #5862

Differential Revision: https://code.wildfiregames.com/D3107

comment:10 by wraitii, 3 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 24308:

Use C++17 to compile 0 A.D.

Supported compilers are Clang 5, GCC 7, Visual Studio 17, Xcode 9.3

Update Atlas alongside since the replacement APIs are c++17 only.
De-activate the StyledTextCtrl module of WxWidgets on mac, since that is a wrapper around the Scintilla Text editor and doesn't compile with C++17 (as it uses auto_ptr). We don't use the editor, so this is also a win on the compilation time front.

Closes #5862

Differential Revision: https://code.wildfiregames.com/D3166

Note: See TracTickets for help on using tickets.