Commit bb5c3cb9 authored by Zeyi (Rice) Fan's avatar Zeyi (Rice) Fan Committed by Facebook GitHub Bot

set SDKROOT when it is not already set

Summary: `SDKROOT` is a requirement if we manually specify the location of the compiler on macOS. Otherwise it wouldn't be able to find the system libraries headers.

Reviewed By: wez

Differential Revision: D22577887

fbshipit-source-id: 98140e6f9e564d665db085d21023986b240b3732
parent 060020e4
......@@ -799,6 +799,7 @@ class Boost(BuilderBase):
self.b2_args = b2_args
def _build(self, install_dirs, reconfigure):
env = self._compute_env(install_dirs)
linkage = ["static"]
if self.build_opts.is_windows():
linkage.append("shared")
......@@ -814,12 +815,14 @@ class Boost(BuilderBase):
for link in linkage:
if self.build_opts.is_windows():
bootstrap = os.path.join(self.src_dir, "bootstrap.bat")
self._run_cmd([bootstrap], cwd=self.src_dir)
self._run_cmd([bootstrap], cwd=self.src_dir, env=env)
args += ["address-model=64"]
else:
bootstrap = os.path.join(self.src_dir, "bootstrap.sh")
self._run_cmd(
[bootstrap, "--prefix=%s" % self.inst_dir], cwd=self.src_dir
[bootstrap, "--prefix=%s" % self.inst_dir],
cwd=self.src_dir,
env=env,
)
b2 = os.path.join(self.src_dir, "b2")
......@@ -843,6 +846,7 @@ class Boost(BuilderBase):
"install",
],
cwd=self.src_dir,
env=env,
)
......
......@@ -187,6 +187,12 @@ class BuildOptions(object):
env["GETDEPS_BUILD_DIR"] = os.path.join(self.scratch_dir, "build")
env["GETDEPS_INSTALL_DIR"] = self.install_dir
# On macOS we need to set `SDKROOT` when we use clang for system
# header files.
if self.is_darwin() and "SDKROOT" not in env:
sdkroot = subprocess.check_output(["xcrun", "--show-sdk-path"])
env["SDKROOT"] = sdkroot.decode().strip()
if self.fbsource_dir:
env["YARN_YARN_OFFLINE_MIRROR"] = os.path.join(
self.fbsource_dir, "xplat/third-party/yarn/offline-mirror"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment