3cbd0a9938
* Add meson support * Modify zlib to be detected via pkgconfig in dependent rules * Modify zlib and expat to be linked to shared libs in dependent rules * Add example usage of Meson rule This commit adds the glib library to the "examples" build. glib requires pcre2, so pcre and libgit2 (a dependent of pcre) have been updated/modified * Add example usage of meson_with_requirements macro This commit adds mesa to the "examples" build. This commit also changes the "examples" build to use the hermetic python toolchain provided by rules_foreign_cc. As such, the python toolchain built by rules_foreign_cc is no longer used, as it cannot be used in workspace rules, .e.g pip_parse(). As such, the python2 build has been removed from the examples as python2 is end-of-life. Until Bazel 4.2.0, the built-in android toolchain required Python 2. As such the minimum supported version has been upversioned to 4.2.0. Note that the BAZEL_VC env var was removed from CI as mesa requires MSVC 2019. * Set visibility for each target in foreign_cc_rule_variant * Apply formatting changes * Get meson examples working with bzlmod Note that a newer version of pkgconfig than that installed in ubuntu 20 must be used to build libxau, therefore the built_pkgconfig_toolchain is now registered |
||
---|---|---|
.. | ||
cmake_android | ||
cmake_crosstool | ||
cmake_defines | ||
cmake_hello_world_lib | ||
cmake_synthetic | ||
cmake_with_bazel_transitive | ||
cmake_with_data | ||
cmake_with_target | ||
cmake_working_dir | ||
configure_modify_input_source | ||
configure_with_bazel_transitive | ||
current_toolchains | ||
deps | ||
make_simple | ||
ninja_simple | ||
third_party | ||
.bazelignore | ||
.bazelrc | ||
BUILD.bazel | ||
MODULE.bazel | ||
README.md | ||
WORKSPACE.bazel | ||
WORKSPACE.bzlmod | ||
requirements.txt | ||
requirements_lock.txt |
README.md
Rules Foreign CC Examples
Top-Level
Top-level examples should contain no dependencies outside of rules_foreign_cc
directly and anything else in
it's directory. The directories should be prefixed with the type of rule they're associated with. Eg
cmake_with_data
(being a cmake_external example) and configure_with_bazel_transitive
(being a configure_make example).
Third Party
Examples of building source from outside of rules_foreign_cc
should be put in the third_party
directory
which is an isolated workspace that gets added to rules_foreign_cc_examples
as an additional
rules_foreign_cc_examples_third_party
repository. In general, these are expected to be expensive to build
so adding new things here should be done selectively. In the top-level package of this workspace, there are
test suites separated by the operating system that all tests need to be registered with. The expected structure of
any example in this workspace are as follows:
third_party/lib
├── BUILD.bazel
├── BUILD.lib.bazel
└── lib_repositories.bzl
BUILD.bazel
This file must contain some sort of test that confirms the targets for the external repo can be successfully
built and ideally ran. The targets here will need to be registered in the test_suite's found in
./third_party/BUILD.bazel
or they will not be ran in CI.
BUILD.lib.bazel
The BUILD file expected to be used in the repository containing the target source code.
lib_repositories.bzl
A file containing a single macro lib_repositories
that should define the desired repository and ensure the
BUILD.lib.bazel
file will correctly be installed when the repository is setup. This macro will need to be
loaded and called in third_party/repositories.bzl
.