bazel: Add repo for package-local target labels (see #3757)
Unqualified target labels don't resolve correctly when the disribution is loaded as an external repo. Mapping, if necessary, can be performed using the `repo_mapping` parameter to http_archive() or local_repository().
This commit is contained in:
parent
c80b00886f
commit
e71a509e5b
|
@ -15,8 +15,8 @@ def declare_exe(name, srcs=[], deps=[], linkopts=[], copts=[], defines=[], data=
|
||||||
copy_filegroups(
|
copy_filegroups(
|
||||||
name = copy_target,
|
name = copy_target,
|
||||||
filegroups = [
|
filegroups = [
|
||||||
"//:sos",
|
"@cef//:sos",
|
||||||
"//:resources",
|
"@cef//:resources",
|
||||||
],
|
],
|
||||||
remove_prefixes = [
|
remove_prefixes = [
|
||||||
"Debug",
|
"Debug",
|
||||||
|
@ -31,13 +31,13 @@ def declare_exe(name, srcs=[], deps=[], linkopts=[], copts=[], defines=[], data=
|
||||||
name = binary_target,
|
name = binary_target,
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
deps = [
|
deps = [
|
||||||
"//:cef_wrapper",
|
"@cef//:cef_wrapper",
|
||||||
"//:cef",
|
"@cef//:cef",
|
||||||
"//:cef_sandbox",
|
"@cef//:cef_sandbox",
|
||||||
] + deps,
|
] + deps,
|
||||||
linkopts = COMMON_LINKOPTS + linkopts,
|
linkopts = COMMON_LINKOPTS + linkopts,
|
||||||
copts = select({
|
copts = select({
|
||||||
"//:linux_dbg": COMMON_COPTS_DEBUG,
|
"@cef//:linux_dbg": COMMON_COPTS_DEBUG,
|
||||||
"//conditions:default": COMMON_COPTS_RELEASE,
|
"//conditions:default": COMMON_COPTS_RELEASE,
|
||||||
}) + COMMON_COPTS + copts,
|
}) + COMMON_COPTS + copts,
|
||||||
defines = defines,
|
defines = defines,
|
||||||
|
|
|
@ -32,7 +32,7 @@ COMMON_LINKOPTS_RELEASE = [
|
||||||
COMMON_LINKOPTS = [
|
COMMON_LINKOPTS = [
|
||||||
"-l{}".format(lib) for lib in STANDARD_LIBS
|
"-l{}".format(lib) for lib in STANDARD_LIBS
|
||||||
] + select({
|
] + select({
|
||||||
"//:linux_dbg": COMMON_LINKOPTS_DEBUG,
|
"@cef//:linux_dbg": COMMON_LINKOPTS_DEBUG,
|
||||||
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix)
|
||||||
out = "{}Info.plist".format(helper_base_name),
|
out = "{}Info.plist".format(helper_base_name),
|
||||||
substitutions = {
|
substitutions = {
|
||||||
"${EXECUTABLE_NAME}": helper_name,
|
"${EXECUTABLE_NAME}": helper_name,
|
||||||
"${PRODUCT_NAME}": helper_name,
|
"${PRODUCT_NAME}": name,
|
||||||
"${BUNDLE_ID_SUFFIX}": bundle_id_suffix,
|
"${BUNDLE_ID_SUFFIX}": bundle_id_suffix,
|
||||||
"${VERSION_SHORT}": VERSION_PLIST,
|
"${VERSION_SHORT}": VERSION_PLIST,
|
||||||
"${VERSION_LONG}": VERSION_PLIST,
|
"${VERSION_LONG}": VERSION_PLIST,
|
||||||
|
@ -41,7 +41,7 @@ def _declare_helper_app(name, info_plist, deps, helper_base_name, helper_suffix)
|
||||||
infoplists = [":{}_InfoPList".format(helper_base_name)],
|
infoplists = [":{}_InfoPList".format(helper_base_name)],
|
||||||
minimum_os_version = MACOS_DEPLOYMENT_TARGET,
|
minimum_os_version = MACOS_DEPLOYMENT_TARGET,
|
||||||
deps = [
|
deps = [
|
||||||
"//:cef_sandbox",
|
"@cef//:cef_sandbox",
|
||||||
] + deps,
|
] + deps,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ def declare_all_helper_apps(name, info_plist, deps):
|
||||||
helper_suffix = v,
|
helper_suffix = v,
|
||||||
) for h, v in HELPERS.items()]
|
) for h, v in HELPERS.items()]
|
||||||
|
|
||||||
def declare_main_app(name, info_plist, deps, linkopts, resources):
|
def declare_main_app(name, info_plist, deps, resources, linkopts=[]):
|
||||||
"""
|
"""
|
||||||
Creates the main .app target.
|
Creates the main .app target.
|
||||||
"""
|
"""
|
||||||
|
@ -103,6 +103,6 @@ def declare_main_app(name, info_plist, deps, linkopts, resources):
|
||||||
"@platforms//os:macos",
|
"@platforms//os:macos",
|
||||||
],
|
],
|
||||||
deps = [
|
deps = [
|
||||||
"//:cef_framework",
|
"@cef//:cef_framework",
|
||||||
] + deps,
|
] + deps,
|
||||||
)
|
)
|
||||||
|
|
|
@ -24,7 +24,7 @@ COMMON_LINKOPTS_RELEASE = [
|
||||||
COMMON_LINKOPTS = [
|
COMMON_LINKOPTS = [
|
||||||
"-framework {}".format(lib) for lib in STANDARD_FRAMEWORKS
|
"-framework {}".format(lib) for lib in STANDARD_FRAMEWORKS
|
||||||
] + select({
|
] + select({
|
||||||
"//:macos_dbg": COMMON_LINKOPTS_DEBUG,
|
"@cef//:macos_dbg": COMMON_LINKOPTS_DEBUG,
|
||||||
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ def declare_exe(name, srcs, manifest_srcs, rc_file, resources_srcs, resources_de
|
||||||
copy_filegroups(
|
copy_filegroups(
|
||||||
name = copy_target,
|
name = copy_target,
|
||||||
filegroups = [
|
filegroups = [
|
||||||
"//:dlls",
|
"@cef//:dlls",
|
||||||
"//:resources",
|
"@cef//:resources",
|
||||||
],
|
],
|
||||||
remove_prefixes = [
|
remove_prefixes = [
|
||||||
"Debug",
|
"Debug",
|
||||||
|
@ -44,15 +44,15 @@ def declare_exe(name, srcs, manifest_srcs, rc_file, resources_srcs, resources_de
|
||||||
name = binary_target,
|
name = binary_target,
|
||||||
srcs = srcs,
|
srcs = srcs,
|
||||||
deps = [
|
deps = [
|
||||||
"//:cef_wrapper",
|
"@cef//:cef_wrapper",
|
||||||
"//:cef",
|
"@cef//:cef",
|
||||||
"//:cef_sandbox",
|
"@cef//:cef_sandbox",
|
||||||
] + deps,
|
] + deps,
|
||||||
linkopts = [
|
linkopts = [
|
||||||
"$(location :{})".format(res_target),
|
"$(location :{})".format(res_target),
|
||||||
] + COMMON_LINKOPTS + linkopts,
|
] + COMMON_LINKOPTS + linkopts,
|
||||||
copts = select({
|
copts = select({
|
||||||
"//:windows_dbg": COMMON_COPTS_DEBUG,
|
"@cef//:windows_dbg": COMMON_COPTS_DEBUG,
|
||||||
"//conditions:default": COMMON_COPTS_RELEASE,
|
"//conditions:default": COMMON_COPTS_RELEASE,
|
||||||
}) + COMMON_COPTS + copts,
|
}) + COMMON_COPTS + copts,
|
||||||
defines = defines,
|
defines = defines,
|
||||||
|
|
|
@ -133,11 +133,11 @@ COMMON_LINKOPTS = [
|
||||||
# can only control through this setting. The main thread (in 32-bit builds
|
# can only control through this setting. The main thread (in 32-bit builds
|
||||||
# only) uses fibers to switch to a 4MiB stack at runtime via
|
# only) uses fibers to switch to a 4MiB stack at runtime via
|
||||||
# CefRunWinMainWithPreferredStackSize().
|
# CefRunWinMainWithPreferredStackSize().
|
||||||
"//:windows_32": ["/STACK:0x80000"],
|
"@cef//:windows_32": ["/STACK:0x80000"],
|
||||||
# Increase the initial stack size to 8MiB from the default 1MiB.
|
# Increase the initial stack size to 8MiB from the default 1MiB.
|
||||||
"//conditions:default": ["/STACK:0x800000"],
|
"//conditions:default": ["/STACK:0x800000"],
|
||||||
}) + select({
|
}) + select({
|
||||||
"//:windows_dbg": COMMON_LINKOPTS_DEBUG,
|
"@cef//:windows_dbg": COMMON_LINKOPTS_DEBUG,
|
||||||
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
"//conditions:default": COMMON_LINKOPTS_RELEASE,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -75,47 +75,47 @@ selects.config_setting_group(
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "windows_dbg",
|
name = "windows_dbg",
|
||||||
match_all = ["@platforms//os:windows", ":dbg"],
|
match_all = ["@platforms//os:windows", "@cef//:dbg"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "windows_fastbuild",
|
name = "windows_fastbuild",
|
||||||
match_all = ["@platforms//os:windows", ":fastbuild"],
|
match_all = ["@platforms//os:windows", "@cef//:fastbuild"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "windows_opt",
|
name = "windows_opt",
|
||||||
match_all = ["@platforms//os:windows", ":opt"],
|
match_all = ["@platforms//os:windows", "@cef//:opt"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "linux_dbg",
|
name = "linux_dbg",
|
||||||
match_all = ["@platforms//os:linux", ":dbg"],
|
match_all = ["@platforms//os:linux", "@cef//:dbg"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "linux_fastbuild",
|
name = "linux_fastbuild",
|
||||||
match_all = ["@platforms//os:linux", ":fastbuild"],
|
match_all = ["@platforms//os:linux", "@cef//:fastbuild"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "linux_opt",
|
name = "linux_opt",
|
||||||
match_all = ["@platforms//os:linux", ":opt"],
|
match_all = ["@platforms//os:linux", "@cef//:opt"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "macos_dbg",
|
name = "macos_dbg",
|
||||||
match_all = ["@platforms//os:macos", ":dbg"],
|
match_all = ["@platforms//os:macos", "@cef//:dbg"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "macos_fastbuild",
|
name = "macos_fastbuild",
|
||||||
match_all = ["@platforms//os:macos", ":fastbuild"],
|
match_all = ["@platforms//os:macos", "@cef//:fastbuild"],
|
||||||
)
|
)
|
||||||
|
|
||||||
selects.config_setting_group(
|
selects.config_setting_group(
|
||||||
name = "macos_opt",
|
name = "macos_opt",
|
||||||
match_all = ["@platforms//os:macos", ":opt"],
|
match_all = ["@platforms//os:macos", "@cef//:opt"],
|
||||||
)
|
)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
@ -165,15 +165,15 @@ cc_library(
|
||||||
"@platforms//os:macos": MAC_COMMON_COPTS,
|
"@platforms//os:macos": MAC_COMMON_COPTS,
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}) + select({
|
}) + select({
|
||||||
":windows_opt": WIN_COMMON_COPTS_RELEASE,
|
"@cef//:windows_opt": WIN_COMMON_COPTS_RELEASE,
|
||||||
":windows_dbg": WIN_COMMON_COPTS_DEBUG,
|
"@cef//:windows_dbg": WIN_COMMON_COPTS_DEBUG,
|
||||||
":windows_fastbuild": WIN_COMMON_COPTS_RELEASE,
|
"@cef//:windows_fastbuild": WIN_COMMON_COPTS_RELEASE,
|
||||||
":linux_opt": LINUX_COMMON_COPTS_RELEASE,
|
"@cef//:linux_opt": LINUX_COMMON_COPTS_RELEASE,
|
||||||
":linux_dbg": LINUX_COMMON_COPTS_DEBUG,
|
"@cef//:linux_dbg": LINUX_COMMON_COPTS_DEBUG,
|
||||||
":linux_fastbuild": LINUX_COMMON_COPTS_RELEASE,
|
"@cef//:linux_fastbuild": LINUX_COMMON_COPTS_RELEASE,
|
||||||
":macos_opt": MAC_COMMON_COPTS_RELEASE,
|
"@cef//:macos_opt": MAC_COMMON_COPTS_RELEASE,
|
||||||
":macos_dbg": MAC_COMMON_COPTS_DEBUG,
|
"@cef//:macos_dbg": MAC_COMMON_COPTS_DEBUG,
|
||||||
":macos_fastbuild": MAC_COMMON_COPTS_RELEASE,
|
"@cef//:macos_fastbuild": MAC_COMMON_COPTS_RELEASE,
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}),
|
}),
|
||||||
defines = [
|
defines = [
|
||||||
|
@ -184,15 +184,15 @@ cc_library(
|
||||||
"@platforms//os:macos": MAC_COMMON_DEFINES,
|
"@platforms//os:macos": MAC_COMMON_DEFINES,
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}) + select({
|
}) + select({
|
||||||
":windows_opt": WIN_COMMON_DEFINES_RELEASE,
|
"@cef//:windows_opt": WIN_COMMON_DEFINES_RELEASE,
|
||||||
":windows_dbg": WIN_COMMON_DEFINES_DEBUG,
|
"@cef//:windows_dbg": WIN_COMMON_DEFINES_DEBUG,
|
||||||
":windows_fastbuild": WIN_COMMON_DEFINES_RELEASE,
|
"@cef//:windows_fastbuild": WIN_COMMON_DEFINES_RELEASE,
|
||||||
":linux_opt": LINUX_COMMON_DEFINES_RELEASE,
|
"@cef//:linux_opt": LINUX_COMMON_DEFINES_RELEASE,
|
||||||
":linux_dbg": LINUX_COMMON_DEFINES_DEBUG,
|
"@cef//:linux_dbg": LINUX_COMMON_DEFINES_DEBUG,
|
||||||
":linux_fastbuild": LINUX_COMMON_DEFINES_RELEASE,
|
"@cef//:linux_fastbuild": LINUX_COMMON_DEFINES_RELEASE,
|
||||||
":macos_opt": MAC_COMMON_DEFINES_RELEASE,
|
"@cef//:macos_opt": MAC_COMMON_DEFINES_RELEASE,
|
||||||
":macos_dbg": MAC_COMMON_DEFINES_DEBUG,
|
"@cef//:macos_dbg": MAC_COMMON_DEFINES_DEBUG,
|
||||||
":macos_fastbuild": MAC_COMMON_DEFINES_RELEASE,
|
"@cef//:macos_fastbuild": MAC_COMMON_DEFINES_RELEASE,
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}),
|
}),
|
||||||
deps = [":cef_wrapper_headers"] +
|
deps = [":cef_wrapper_headers"] +
|
||||||
|
@ -238,8 +238,8 @@ cc_import(
|
||||||
alias(
|
alias(
|
||||||
name = "cef_sandbox",
|
name = "cef_sandbox",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//:dbg": ":cef_sandbox_debug",
|
"@cef//:dbg": "@cef//:cef_sandbox_debug",
|
||||||
"//conditions:default": ":cef_sandbox_release",
|
"//conditions:default": "@cef//:cef_sandbox_release",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ filegroup(
|
||||||
name = "dlls_opt",
|
name = "dlls_opt",
|
||||||
srcs = ["Release/{}".format(name) for name in WIN_DLLS] +
|
srcs = ["Release/{}".format(name) for name in WIN_DLLS] +
|
||||||
select({
|
select({
|
||||||
"//:windows_64": ["Release/{}".format(name) for name in WIN_DLLS_X64],
|
"@cef//:windows_64": ["Release/{}".format(name) for name in WIN_DLLS_X64],
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
@ -256,7 +256,7 @@ filegroup(
|
||||||
name = "dlls_dbg",
|
name = "dlls_dbg",
|
||||||
srcs = ["Debug/{}".format(name) for name in WIN_DLLS] +
|
srcs = ["Debug/{}".format(name) for name in WIN_DLLS] +
|
||||||
select({
|
select({
|
||||||
"//:windows_64": ["Debug/{}".format(name) for name in WIN_DLLS_X64],
|
"@cef//:windows_64": ["Debug/{}".format(name) for name in WIN_DLLS_X64],
|
||||||
"//conditions:default": None,
|
"//conditions:default": None,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
@ -264,8 +264,8 @@ filegroup(
|
||||||
alias(
|
alias(
|
||||||
name = "dlls",
|
name = "dlls",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//:dbg": ":dlls_dbg",
|
"@cef//:dbg": "@cef//:dlls_dbg",
|
||||||
"//conditions:default": ":dlls_opt",
|
"//conditions:default": "@cef//:dlls_opt",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -282,8 +282,8 @@ filegroup(
|
||||||
alias(
|
alias(
|
||||||
name = "sos",
|
name = "sos",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//:dbg": ":sos_dbg",
|
"@cef//:dbg": "@cef//:sos_dbg",
|
||||||
"//conditions:default": ":sos_opt",
|
"//conditions:default": "@cef//:sos_opt",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -300,7 +300,7 @@ filegroup(
|
||||||
"Release/snapshot_blob.bin",
|
"Release/snapshot_blob.bin",
|
||||||
"Release/v8_context_snapshot.bin",
|
"Release/v8_context_snapshot.bin",
|
||||||
"Release/vk_swiftshader_icd.json",
|
"Release/vk_swiftshader_icd.json",
|
||||||
":resources_common",
|
"@cef//:resources_common",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -310,15 +310,15 @@ filegroup(
|
||||||
"Debug/snapshot_blob.bin",
|
"Debug/snapshot_blob.bin",
|
||||||
"Debug/v8_context_snapshot.bin",
|
"Debug/v8_context_snapshot.bin",
|
||||||
"Debug/vk_swiftshader_icd.json",
|
"Debug/vk_swiftshader_icd.json",
|
||||||
":resources_common",
|
"@cef//:resources_common",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
alias(
|
alias(
|
||||||
name = "resources",
|
name = "resources",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//:opt": ":resources_opt",
|
"@cef//:opt": "@cef//:resources_opt",
|
||||||
"//conditions:default": ":resources_dbg",
|
"//conditions:default": "@cef//:resources_dbg",
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -352,15 +352,15 @@ cc_import(
|
||||||
alias(
|
alias(
|
||||||
name = "cef",
|
name = "cef",
|
||||||
actual = select({
|
actual = select({
|
||||||
"//:dbg": ":cef_dbg",
|
"@cef//:dbg": "@cef//:cef_dbg",
|
||||||
"//conditions:default": ":cef_opt",
|
"//conditions:default": "@cef//:cef_opt",
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
apple_dynamic_framework_import(
|
apple_dynamic_framework_import(
|
||||||
name = "cef_framework",
|
name = "cef_framework",
|
||||||
framework_imports = select({
|
framework_imports = select({
|
||||||
"//:dbg": glob(["Debug/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
"@cef//:dbg": glob(["Debug/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
||||||
"//conditions:default": glob(["Release/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
"//conditions:default": glob(["Release/{}.framework/**".format(CEF_FRAMEWORK_NAME)]),
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue