Skip to content
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":
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we always want to do this? Surely if it was linking say share/ into the tree you'd also want the folder structure to be maintained?

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