Skip to content

Commit ddfe61a

Browse files
brentleyjonesBrentley Jones
authored andcommitted
Consider DEVELOPER_DIR when building wrapped_clang
1 parent 2300e6d commit ddfe61a

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

tools/cpp/cc_configure.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ cc_autoconf = repository_rule(
165165
"CC_CONFIGURE_DEBUG",
166166
"CC_TOOLCHAIN_NAME",
167167
"CPLUS_INCLUDE_PATH",
168+
"DEVELOPER_DIR",
168169
"GCOV",
169170
"HOMEBREW_RUBY_PATH",
170171
"SYSTEMROOT",

tools/cpp/osx_cc_configure.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,11 @@ def _get_escaped_xcode_cxx_inc_directories(repository_ctx, cc, xcode_toolchains)
5050
return include_dirs
5151

5252
def compile_cc_file(repository_ctx, src_name, out_name):
53+
env = repository_ctx.os.environ
5354
xcrun_result = repository_ctx.execute([
5455
"env",
5556
"-i",
57+
"DEVELOPER_DIR={}".format(env.get("DEVELOPER_DIR", default = "")),
5658
"xcrun",
5759
"--sdk",
5860
"macosx",

tools/osx/xcode_configure.bzl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,11 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
115115
to build and run xcode-locator, or None if the run was successful.
116116
"""
117117
xcodeloc_src_path = str(repository_ctx.path(xcode_locator_src_label))
118+
env = repository_ctx.os.environ
118119
xcrun_result = repository_ctx.execute([
119120
"env",
120121
"-i",
122+
"DEVELOPER_DIR={}".format(env.get("DEVELOPER_DIR", default = "")),
121123
"xcrun",
122124
"--sdk",
123125
"macosx",
@@ -181,10 +183,15 @@ def run_xcode_locator(repository_ctx, xcode_locator_src_label):
181183

182184
def _darwin_build_file(repository_ctx):
183185
"""Evaluates local system state to create xcode_config and xcode_version targets."""
184-
xcodebuild_result = repository_ctx.execute(
185-
["env", "-i", "xcrun", "xcodebuild", "-version"],
186-
_EXECUTE_TIMEOUT,
187-
)
186+
env = repository_ctx.os.environ
187+
xcodebuild_result = repository_ctx.execute([
188+
"env",
189+
"-i",
190+
"DEVELOPER_DIR={}".format(env.get("DEVELOPER_DIR", default = "")),
191+
"xcrun",
192+
"xcodebuild",
193+
"-version",
194+
], _EXECUTE_TIMEOUT)
188195

189196
(toolchains, xcodeloc_err) = run_xcode_locator(
190197
repository_ctx,

0 commit comments

Comments
 (0)