Latest Posts

Topic: std::optional or boost::optional?

teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2020-10-25, 20:54

GunChleoc wrote:

The decision to switch over to C++11 was made just before I joined the team, so I don't know. I was certainly glad to have nullptr, unique_ptr and ranged loops available, and one of my early jobs was to help with code cleanups for the transition. In fact, I am still working on that cleanup on and off years later - with the help of clang-tidy now face-smile.png

I think that at that time Debian stable was a prototype of ancient-enough system. Even that was not stone carved, since Widelands swiched from libsdl to libsdl2 sooner than that.

No std::optional then, because we support GCC5 and we'd need GCC7 for that.

What needs to happen, before we might require GCC >= 7 ? If you state it aloud now, somebody might remember and make noise when the day arrives.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-10-26, 05:49

I had a look at our daily PPA's build logs. Ubuntu 16.04 LTS (Xenial Xerus) is using GCC5, so the plan is to wait for the LTS Maintenance Updates to run out, like we did for Ubuntu 14.04 LTS (Trusty Tahr). This will be next summer. The current LTS version (Ubuntu 20.04 LTS (Focal Fossa)) uses GCC9, so that will be a big leap ahead in modernization face-smile.png

Windows shouldn't be a problem, since we use Arch Linux vie MSys2 for the build, which is always cutting edge.

For Mac, our oldest supported version on Travis is currently running with AppleClang 10.0.0.10001145.


Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2020-10-31, 13:53

GunChleoc wrote:

We have recently dropped support for gcc 4.8 as Ubuntu Trusty is no longer under official support. We could research the prerequisites for getting a build on a vanilla Xenial and use that as a measuring rod.

There seems to be a gcc-7 PPA for xenial. Since xenial is nearing its EOL, maybe that is not worth it.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-10-31, 16:52

Our widelands-daily Xenial PPA is using GNU 5.4.0. If you know how to make that use GCC-7, we could do that.


Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2020-11-01, 18:49

GunChleoc wrote:

Our widelands-daily Xenial PPA is using GNU 5.4.0. If you know how to make that use GCC-7, we could do that.

I just tried installing Xenial on a VM. Also installed Widelands dependencies, pulled in the source code, changed C++ standard in CMakefile to C++17, and did all this. The result was a widelands, binary, seemingly compiled with gcc-7.

I did not try modifying the source code, and ensure that stuff like std::optional works right.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-11-01, 19:57

Well, there is one thing we can't do with the PPA out of the box:

changed C++ standard in CMakefile to C++17, and did all this

The problem is:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test

I don't think we can work that into the PPA.


Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2020-11-15, 16:21

GunChleoc wrote:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test ~~~~

I don't think we can work that into the PPA.

The reference to C++11 was removed from CMakeLists.txt earlier this week. Is that related to this discussion somehow?


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2020-11-16, 09:40

It wasn't removed, it was moved for Visual Studio support https://github.com/widelands/widelands/commit/6bf3c96e9261664f3a5b1d46bf564b316383bac8


Busy indexing nil values

Top Quote