Why configure.py looks for "c++" instead of....

48 views
Skip to first unread message

kromak

unread,
Dec 29, 2022, 6:51:56 AM12/29/22
to ninja-build

g++? Doesn't seem more reasonable to look for the actual name of the compiler? Or even better, to look for both?

Ben Boeckel

unread,
Dec 29, 2022, 10:17:53 AM12/29/22
to kromak, ninja-build
On Mon, Dec 26, 2022 at 16:27:48 -0800, kromak wrote:
> g++? Doesn't seem more reasonable to look for the actual name of the
> compiler? Or even better, to look for both?

`c++` is the vendor-agnostic way of running a C++ compiler. Since there
are only a handful of implementations these days, it might seem
anachronistic, but `cc` is the POSIX-y way to get "whatever the platform
C compiler is" and is quite handy for portable build scripts. `c++` is
the same for C++.

--Ben
Reply all
Reply to author
Forward
0 new messages