rules_foreign_cc/examples
jheaff1 3cbd0a9938
Add meson support (#986)
* 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
2023-06-09 11:29:12 +01:00
..
cmake_android Restructured rules to match architecture (#555) 2021-03-12 16:54:14 +00:00
cmake_crosstool Renamed a BUILD file (#662) 2021-06-04 06:50:52 -07:00
cmake_defines Fix quoting for cmake (#703) 2021-07-28 18:12:53 +01:00
cmake_hello_world_lib Add ability to specify DLL dir (#939) 2022-07-27 16:46:15 +00:00
cmake_synthetic Add missing includes for std::runtime_error (#728) 2021-07-19 18:40:31 +00:00
cmake_with_bazel_transitive Add missing includes for std::runtime_error (#728) 2021-07-19 18:40:31 +00:00
cmake_with_data Adapt tests to new cc_binary file extension on macOS (#834) 2021-12-06 15:50:55 -08:00
cmake_with_target Ran buildifier (#581) 2021-03-22 08:13:48 -07:00
cmake_working_dir Add missing includes for std::runtime_error (#728) 2021-07-19 18:40:31 +00:00
configure_modify_input_source Allow all source files to be modified in configure_make when using configure_in_place = True (#856) 2022-01-10 09:48:37 +00:00
configure_with_bazel_transitive Adds toolchain for freebsd. (#794) 2021-11-29 10:54:06 +00:00
current_toolchains Fix current toolchains (#978) 2022-11-02 22:02:55 +00:00
deps Add bzlmod support files. (#999) 2023-05-06 08:56:00 +01:00
make_simple Replace `escape_locations` with `escape_locations_and_make_variables` everywhere (#861) 2022-02-09 22:34:12 +00:00
ninja_simple Adds toolchain for freebsd. (#794) 2021-11-29 10:54:06 +00:00
third_party Add meson support (#986) 2023-06-09 11:29:12 +01:00
.bazelignore Update bazelignore files (#854) 2022-01-06 21:13:25 +00:00
.bazelrc Add meson support (#986) 2023-06-09 11:29:12 +01:00
BUILD.bazel Add meson support (#986) 2023-06-09 11:29:12 +01:00
MODULE.bazel Add meson support (#986) 2023-06-09 11:29:12 +01:00
README.md Added architecture documentation (#544) 2021-03-09 10:49:13 -08:00
WORKSPACE.bazel Add meson support (#986) 2023-06-09 11:29:12 +01:00
WORKSPACE.bzlmod Add bzlmod support files. (#999) 2023-05-06 08:56:00 +01:00
requirements.txt Add meson support (#986) 2023-06-09 11:29:12 +01:00
requirements_lock.txt Add meson support (#986) 2023-06-09 11:29:12 +01:00

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.