How best to build Geant4 with std=c++17

Does anyone know the proper (best, official, etc.) way to build Geant4 applications with C++17?
Specifically, my Geant4 application (a.k.a. use code) requires use an up-to-date ROOT version (I have 6.18.04b) whose TString class requires C++17 (uses std::string_view).
From some discussions by the developers, it was clear that Geant4’ source files are compatible with C++17 and that a sane solution starts with building Geant using the same C++ standard.
(before that, I used the default Unix build, so make stuck in std==c++11 twice when building each source code).
The official PDF installation guide pointed my to the right CMake option:
and this worked fine.
Except my application was still building with std=c++11.
So in addition to my usual hack of binmake.gmk (*) , I also ended up hacking architecture.gmk by replacing the lines hard-coding the use of c++11 with similiar lines for c++17. This worked.

(*) it allows user-supplied flags after the LDLIBS, so that even the application’s main can use the ROOT libraries

Surely there’s a better way. Right?

It’s not documented(*), but you can set the G4USE_STD17 make/env variable to automatically add -std=c++17 to the flags. If you set it in the GNUmakefile, which I’d recommend, it needs to be before the inclusion of any of the Geant4 GNUmake .gmk files.

(*) The GNUmake system is deprecated and is likely to be removed in the 2021 release (It will remain supported up to 10.7). It’s recommended to migrate to CMake or other modern build systems for end applications.