use cpp-11 if installed on macOS

This commit is contained in:
alex 2021-08-09 16:59:05 +01:00
parent 508c8ea0c2
commit 932876f423
No known key found for this signature in database
GPG Key ID: E907B20C17C70B03

View File

@ -606,6 +606,9 @@ if __name__ == "__main__":
# on macOS, /usr/bin/cpp defaults to clang rather than gcc (but we need gcc's) # on macOS, /usr/bin/cpp defaults to clang rather than gcc (but we need gcc's)
if args.cpp is None and sys.platform == "darwin" and "Free Software Foundation" not in exec_shell(["cpp", "--version"]): if args.cpp is None and sys.platform == "darwin" and "Free Software Foundation" not in exec_shell(["cpp", "--version"]):
if "Free Software Foundation" in exec_shell(["cpp-11", "--version"]):
args.cpp = "cpp-11"
else:
print("error: system C preprocessor is not GNU!") print("error: system C preprocessor is not GNU!")
print("This is a known issue on macOS - only clang's cpp is installed by default.") print("This is a known issue on macOS - only clang's cpp is installed by default.")
print("Use 'brew' to obtain GNU cpp, then run this script again with the --cpp option, e.g.") print("Use 'brew' to obtain GNU cpp, then run this script again with the --cpp option, e.g.")