Using cc_import + interface_library/shared_library to link libcef.lib causes
libcef.dll to be copied as a transitive dependency, leading to issues with
complex Bazel configs. Instead, we explicitly link libcef.lib in the binary
target (cc_binary + linkopts/additional_linker_inputs) and explicitly copy
libcef.dll to the target directory.
- Add `declare_[cc|objc]_library` macros to configure common `copts`
and `local_defines` (where supported) on `[cc|objc]_library`
targets. This limits the scope of defines to the specific target
without inheritance by dependent targets.
- `objc_library` does not currently support `local_defines` so we
use `copts` instead of MacOS.
- Use `**kwargs` to pass all other arguments to the actual cc
target declaration.
- Headers that are included by .rc files need to be supplied to
`declare_exe` via the `resources_deps` attribute (passed as the `deps
attribute to `compile_rc`). The headers must be part of a cc_library
target via either the `hdrs` or `srcs` attribute.
- File paths for CEF resources are prefixed with "external/<repo>"
when CEF is loaded as an external repo. Update `copy_filegroups` to
work with these paths.
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().
Add support for building the CEF binary distribution using Bazel
and the default platform toolchain. Tested to work for Windows
x64, MacOS ARM64 and x64 (cross-compile from ARM64), and
Linux x64. Windows x86 (cross-compile from x64) is known to
be broken, see https://github.com/bazelbuild/bazel/issues/22164.
Includes minor changes to tests directory structure to meet
Bazel build requirements.