Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add local includes #135

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 2 additions & 0 deletions cc/toolchains/yocto_generic/config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def _impl(ctx):
),
]
common_compile_flags = [
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
# Reproducibility
"-Wno-builtin-macro-redefined",
"-D__DATE__=\"redacted\"",
Expand Down
Loading