I'm building an installer/downloader that detects the architecture and downloads the version of the main executable compiled with that architecture. If it doesn't exist yet, it'll be compiled on the server on the fly.
I can easily get the CPU name, e.g. "Intel(R) Core(TM) i9-10900KF CPU @ 3.70GHz", but how do I convert this to the correct string for the -march and -mtune settings for MinGW?
I cannot rely on any dependencies, it need to be able to determine this using a standalone script or executable that can be run by the installer to determine the correct string. Or I could use a massive list of all CPU names converted to -march strings, but where would I find that?
EDIT: I cannot use -march=native because the compiler is not on the client machine. What I'm doing is detecting the architecture on the client machine by an installer, then compiling for their architecture on the server. So I cannot use -march=native.