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

fix: keep original header file layout when symlink into ext_include_dir #1266

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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: 11 additions & 1 deletion foreign_cc/private/framework.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -767,13 +767,23 @@ def _symlink_contents_to_dir(dir_name, files_list):
path = _file_path(file).strip()
if path:
lines.append("##symlink_contents_to_dir## \
$$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/{} True".format(path, dir_name))
$$EXT_BUILD_ROOT$$/{} $$EXT_BUILD_DEPS$$/{} True".format(path, _get_dir_name(dir_name, file)))

return lines

def _file_path(file):
return file if type(file) == "string" else file.path

def _get_dir_name(dir, file):
if dir == "include":
if type(file) == "File" and file.owner != None and file.owner.package != "":
workspace_root = file.owner.workspace_root
path = "/".join(file.path.split("/")[:-1])
prefix = "{}/".format(workspace_root)
if path.startswith(prefix):
return "{}/{}".format(dir, path.removeprefix(prefix))
return dir

_FORBIDDEN_FOR_FILENAME = ["\\", "/", ":", "*", "\"", "<", ">", "|"]

def _check_file_name(var):
Expand Down
Loading