Skip to content

Commit d0ed97f

Browse files
authored
Populate CXX during builds to avoid calling the system toolchain (#545)
Closes #512
1 parent 2a9167e commit d0ed97f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cpython-unix/build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,9 @@ def add_target_env(env, build_platform, target_triple, build_env):
101101
env["HOST_CC"] = settings["host_cc"]
102102
env["HOST_CXX"] = settings["host_cxx"]
103103
env["CC"] = settings["target_cc"]
104+
# We always set CXX, otherwise a build could bypass our toolchain
105+
# accidentally, e.g., on macOS where `g++` links to the system clang.
106+
env["CXX"] = settings.get("target_cxx", settings.get("host_cxx"))
104107

105108
if settings.get("bolt_capable"):
106109
env["BOLT_CAPABLE"] = "1"

0 commit comments

Comments
 (0)