mirror of
https://github.com/facebook/proxygen.git
synced 2025-08-08 18:02:05 +03:00
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
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ba88d5d42e
commit
eb5b082107
@@ -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"
|
||||
|
Reference in New Issue
Block a user