dolphin icon indicating copy to clipboard operation
dolphin copied to clipboard

Convert DolphinTool to modules

Open Zopolis4 opened this issue 3 years ago • 6 comments

This serves really more so as a demo to how to convert to modules:

  • Wrap all includes in a global module fragment
  • Add any includes in the header to the implementation file
  • Add any variables in the header to the implementation file
  • Export the functions declared as public in the header

A bit of module discussion: Using modules will on the whole remove the need for precompiled headers, as there are no headers. We should also move to C++23 when that is finished, as it will provide a standard way to import the stdlib, which will also cut out a lot of the need for PCH. While we currently have to wrap most of the file in a namespace block, I am working on a paper that will remove the need for this. ~If~ When it gets accepted, it will be into C++26, so I propose when that happens we move to C++26, but do not use any additional features until it becomes finalized.

Zopolis4 avatar Sep 12 '22 06:09 Zopolis4

Ok linux builders are failing due to pulseaudio skill issues, no idea what windows is doing. I'd hoped to avoid the /experimental:module flag because that enables a wide variety of nonstandard behaviour, but I guess I'll give it a try.

Zopolis4 avatar Sep 12 '22 22:09 Zopolis4

One thing worth considering: we should avoid making difficult-to-follow blame history when converting header-only Common files to *.cpp file extensions. In other words, do whatever makes the change register as a file being moved vs one being deleted and another being added (my inexperience with Git limits me from saying what, exactly).

Minty-Meeo avatar Sep 12 '22 23:09 Minty-Meeo

The change is, to my knowledge, defined by how much you change the file and what git counts as a modification. You could also split it into two commits if you end up changing it enough to trigger git.

Zopolis4 avatar Sep 12 '22 23:09 Zopolis4

Ah-- this is breaking on the windows builders because Visual Studio wants module code to be in .ixx or .cppm files. I'll look into a CompileAs option.

Zopolis4 avatar Sep 12 '22 23:09 Zopolis4

This is also failing, because, along with our buildbots being a bit behind, CMake doesn't have good module support in larger projects. See issue.

Zopolis4 avatar Sep 15 '22 01:09 Zopolis4

CMake is getting better-- I'll wait until an actual numbered release is pushed out and the gcc and clang stuff is merged upstream, but its a lot closer than it was. See issue.

Zopolis4 avatar Dec 15 '22 00:12 Zopolis4