Skip to content

Commit

Permalink
add local includes
Browse files Browse the repository at this point in the history
  • Loading branch information
jungleraptor committed May 24, 2024
1 parent 27e7d4e commit 83b7852
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions cc/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ def _symbolizer_env(val):
return select({
# The + operator is not supported on dict and select types so we need to be
# clever here.
Label("//cc:enable_symbolizer_x86_64_linux"): dict(val, **{"ASAN_SYMBOLIZER_PATH": "$(location @x86_64-linux-llvm//:symbolizer)"}),
Label("//cc:enable_symbolizer_x86_64_darwin"): dict(val, **{"ASAN_SYMBOLIZER_PATH": "$(location @x86_64-darwin-llvm//:symbolizer)"}),
Label("//cc:enable_symbolizer_x86_64_linux"): dict(val, **{"UBSAN_SYMBOLIZER_PATH": "$(location @x86_64-linux-llvm//:symbolizer)"}),
Label("//cc:enable_symbolizer_x86_64_darwin"): dict(val, **{"UBSAN_SYMBOLIZER_PATH": "$(location @x86_64-darwin-llvm//:symbolizer)"}),
"//conditions:default": {},
})

Expand Down Expand Up @@ -506,6 +506,8 @@ def swift_c_tool(**kwargs):
nocopts: List of flags to remove from the default compile
options. Use judiciously.
"""
local_includes = _construct_local_includes(kwargs.pop("local_includes", []))

nocopts = kwargs.pop("nocopts", [])

copts = _common_cc_opts(nocopts, pedantic = False)
Expand All @@ -515,7 +517,7 @@ def swift_c_tool(**kwargs):

c_standard = _c_standard(extensions, standard)

kwargs["copts"] = copts + c_standard + kwargs.get("copts", [])
kwargs["copts"] = copts + c_standard + local_includes + kwargs.get("copts", [])

kwargs["data"] = kwargs.get("data", []) + _symbolizer_data()

Expand Down Expand Up @@ -551,6 +553,8 @@ def swift_cc_tool(**kwargs):
nocopts: List of flags to remove from the default compile
options. Use judiciously.
"""
local_includes = _construct_local_includes(kwargs.pop("local_includes", []))

nocopts = kwargs.pop("nocopts", [])

copts = _common_cc_opts(nocopts, pedantic = False)
Expand All @@ -561,7 +565,7 @@ def swift_cc_tool(**kwargs):

cxxopts = _common_cxx_opts(exceptions, rtti, standard)

kwargs["copts"] = copts + cxxopts + kwargs.get("copts", [])
kwargs["copts"] = copts + cxxopts + local_includes + kwargs.get("copts", [])

kwargs["data"] = kwargs.get("data", []) + _symbolizer_data()

Expand Down

0 comments on commit 83b7852

Please sign in to comment.