2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-30 16:42:07 +00:00
Commit graph

52 commits

Author SHA1 Message Date
Javier Maestro 9edaefe13c
fix: move all bazelbuild links to bazel-contrib (#1315) 2024-11-06 15:35:23 +00:00
Brad Neuman 07f78a48cf
Fix documentation link in README.md (#1301) 2024-11-01 16:56:13 +00:00
James Sharpe ddda554d2a
Remove explicit mention of bazel 4.x support (#1146) 2023-12-21 11:26:27 +00:00
Mike Lundy 01cf7897e5
Allow runnable_binary to work on non-external targets (#1100) 2023-10-14 14:24:09 +01:00
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
jheaff1 2c6262f8f4
Hermetic pkg config (#979) 2022-11-09 11:54:39 +00:00
Yesudeep Mangalapilly a2f1e5d8c3
Adds toolchain for freebsd. (#794)
* Adds toolchain for freebsd.

* Address buildifier lint warnings.

* Use /usr/bin/env bash

* Leave the Linux-specific shebang alone.

* Adds note about Bazel CI issue requesting for FreeBSD support and experimental status.

* Fix typo.

* Clean up trailing whitespace.

* Updates bazel-skylib version for tests to pass on FreeBSD.

* Update foreign_cc/repositories.bzl

Co-authored-by: UebelAndre <github@uebelandre.com>
2021-11-29 10:54:06 +00:00
UebelAndre cbfe9c0600
Update min tested Bazel version to 4.0.0 (#802) 2021-10-19 09:15:00 -07:00
UebelAndre a7f1c9e604
Docs are now auto-generated using mdbook (#692) 2021-06-22 13:10:31 -07:00
UebelAndre 4e45a4f6b6
Restored generated docs (#691) 2021-06-20 15:25:43 -07:00
UebelAndre f471bbfeb2
Updated documentation and removed the need to commit updated docs (#652) 2021-06-02 19:58:56 +01:00
Takeo Sawada 11e971d78b
Fix a typo in README.md (#618) 2021-04-22 08:59:46 +01:00
UebelAndre 144814658a
Fixed min version in docs (#579) 2021-03-22 14:25:05 +00:00
UebelAndre 07e1645dcc
Added test for ensuring docs are always appropriately updated (#576)
* Added test for ensuring docs are always appropriately updated

* Updated docs
2021-03-20 20:11:57 +00:00
UebelAndre 3389401e19
Moved "news" into it's own file (#570) 2021-03-17 08:45:28 -07:00
UebelAndre 4b265b0e61
Updated top level docs (#569) 2021-03-17 08:34:02 -07:00
UebelAndre e4399415b8
Added "targets" API (#556)
* Added `targets` API to all existing build rules

* Updated examples

* Restore making the make toolchain always available.

* Add support for generator cmake parsing and setting CMAKE_MAKE_PROGRAM

* Cleaned up duplicate generator arguments

* Fixed cmake tests

* Updated docs

* Addressed PR feedback

* Fixed missing and incorrect generators

* Fixed `generate_args` name
2021-03-17 13:42:44 +00:00
UebelAndre 83e6cf48cf
Moved workspace_definitions.bzl to foreign_cc/repositories.bzl to solve for bzl-visibility issues. (#557) 2021-03-12 09:08:13 -08:00
UebelAndre edbfa3bfa9
Restructured rules to match architecture (#555)
* Restructured rules to match architecture

* Added exports of all symbols in the deprecated location for legacy support

* Updated examples
2021-03-12 16:54:14 +00:00
UebelAndre 0e0d9a26f2
Prefixed all output attributes with out_ to make their use clearer (#538)
* Prefixed all output attributes with `out_` to make their use clearer

* Updated examples
2021-03-11 17:14:00 +00:00
UebelAndre f307e857f6
Renamed cmake_external to cmake (#539)
* Renamed `cmake_external` rule to `cmake`

* Updated examples
2021-03-09 10:55:01 -08:00
James Sharpe 9e9c65899d
Add sha256 (#534) 2021-03-01 15:14:07 -08:00
James Sharpe 1222c48f98
Indicate we will only be testing 4.0.0 rather than 'requiring' 4.0.0 (#533) 2021-03-01 14:41:25 -08:00
James Sharpe 9ebf3d4d6b
Update README for release (#531)
* Update README for release

* Add additional deprecation

* Remove unused version file

* Update README.md
2021-03-01 11:31:57 -08:00
UebelAndre e285764b78
Restructed examples and enabled more testing (#515)
* Reorganized examples

* Documentation

* Third party
2021-02-26 20:21:13 +00:00
James Sharpe 4520018bc2
Make generate_crosstool=True the default for cmake. (#523)
This was previously setting `CMAKE_SYSTEM_NAME` in the generated
toolchain file but setting this explicitly enables `CMAKE_CROSSCOMPILING`
(see https://cmake.org/cmake/help/v3.19/variable/CMAKE_CROSSCOMPILING.html#variable:CMAKE_CROSSCOMPILING)
which breaks projects that use `TRY_RUN`
2021-02-24 14:45:36 -08:00
UebelAndre 80143e7c5a
Updated master -> main (#504) 2021-02-12 15:05:18 -08:00
UebelAndre 62672f382a
Updated CI build tag to only user the main branch (#471) 2021-01-25 13:18:52 -08:00
UebelAndre 9b6a8f675c
Add tests for checking the minimum supported version to CI (#469) 2021-01-25 19:07:05 +00:00
UebelAndre 8b8f31dd1b
Created a ./docs directory to house documentation (#466)
* Added links to docs to top level README

* Updated more docs

* Added generated header
2021-01-24 15:23:19 -08:00
Benjamin Peterson d54c78ab86
Migrate to modern linking input API. (#434)
* Migrate to modern linking input API.

See https://github.com/bazelbuild/bazel/issues/10860.

* Bump required Bazel version.
2020-10-26 15:26:01 +01:00
Attila Oláh ea571fcdd1
Add a GNU Make toolchain (#379)
* Use `.format()` instead of `%` for constructing `make_commands`.

I'm about to add a third substitution parameter to these lines, and it's
already getting a bit crowded. This is a no-op change, but should make
the follow-up commits more readable.

* Add `make_toolchain` toolchain type.

Add a toolchain that implements it using the pre-installed system
`make`. Make use of this toolchain in the `make()` rule.

* Use the `make` toolchain in configure and cmake scripts as well.

This allows the registered `make` toolchain to be used not just in make,
but also in cmake and configure_make targets. As a result, one can
either ship their own `make`, built for the execution environment, or
use a custom `make`, e.g. one that calls `emmake make`.

To make this backwards compatible with `make_commands`, the substitution
will only replace the leading word `make` from any line in
`make_commands`. Thus, existing rules that specify a `make_commands`
attribute that refers to the binary simply as `make` should still work
with any toolchain implementation that provides the binary.

* Update `README.md`.

Describe the new toolchain type.

* Add `BootstrapMake` to bootstrap a `make` toolchain.

This allows the `make` toolchain to be used even without GNU Make being
pre-installed on the system.

* Add example Gnu Make boostrap target.

Test manually using:

```
$ cd examples
$ bazel build //build_make_itself:maketool
```
2020-09-07 10:48:26 +02:00
Andy Yankovsky 3cfd45d5d4 Fix typo 2020-08-21 13:51:58 +02:00
irengrig 8372f383cf
Allow to specify working directory for cmake_external (#390)
Allow to specify working directory for cmake_external
For LLVM case, when main CMakeLists.txt is in the /llvm subdirectory in the source tree

Co-authored-by: Andy Yankovsky <weratt@gmail.com>
2020-04-24 09:16:21 +02:00
irengrig 6bb0536452
Remove experimental disclaimer. Fixes #307. (#316) 2019-10-23 16:06:34 +02:00
irengrig bcb7a345f7
Remove support for the versions of Bazel before 0.22 (#234)
- as 0.23 is already released
- to have only one variant of framework code
2019-03-11 16:34:56 +01:00
irengrig 0984825255
Correct headers (#209)
* Update README.md because of Bazel 0.22.0 release

- with Bazel 0.22.0, no flags are required to use rules_foreign_cc
- improve Bazel versions related information
- add link to "rules_foreign_cc take-aways"

* Correct headers in README
2019-01-29 14:55:29 +01:00
irengrig 6f0005be09
Update README.md because of Bazel 0.22.0 release (#208)
- with Bazel 0.22.0, no flags are required to use rules_foreign_cc
- improve Bazel versions related information
- add link to "rules_foreign_cc take-aways"
2019-01-29 14:52:47 +01:00
irengrig 3d4fe6d0c8
Add doc (#205)
* Add a note about broken with Bazel 0.22 on Windows

* Add a note about broken with Bazel 0.22 on Windows
2019-01-28 13:36:56 +01:00
irengrig c51480261c
Extract shell fragments into a toolchain (#196)
* Extract shell fragments into a toolchain

Construct script in framework.bzl using special notation for calling
shell fragments, defining and referencing environment variables;
have the script converted from this special notation into a real script
(see README.md notes.)
The special notation is used to keep script construction in code still readable.

Tools scripts (cmake, ninja) were also converted.

* Fix reference to environment variables in examples

.. and reference it correctly $$var_name$$ so it is replaced further

* Review comments: documentation, explicitly mark functions from toolchain

- mark functions from shell toolchain as ##funname##, so that they
can not be mixed with usual shell functions

* Fix operating system name for windows in toolchain file

* Additional env vars for windows

* Correct cmake tool build

* Do not build ninja on Windows

* When run on Windows under msys, find utility from Window could "leak"...

into the script. Use heuristics to use /usr/bin/find if it exists.
Also, use pwd -W to get Windows-styled paths (for cmake)
2019-01-18 18:06:10 +01:00
irengrig 4dc369a845
Do not support Bazel before 0.20 (#195) 2019-01-08 18:21:22 +01:00
irengrig 99ea1b09fc
Extract cmake and ninja into a toolchain; provide defaults. (#192)
* Extract cmake and ninja into a toolchain; provide defaults.

In the workspace-level rule registration function, default toolchain
implementations are registered for all platforms, which are calling
the cmake and ninja just by name, assuming they are preinstalled.

Also, the user can pass the custom toolchains in the initialization
function, they will be registered before the defaults.

* Do not run ninja build test for now without nested workspaces support

* Corrections after merge

* Always build ninja from sources for tests, correct initialization order

* Add example of using prebuilt artefact in the native tools toolchain.

* Review comments, have native_tool_toolchain#target, not label

+ improve documentation

* Correct ninja toolchain label

* Correct documentation in native_tools_toolchain.bzl
2019-01-08 12:25:16 +01:00
irengrig 4c426c839e
Add build status to README (#176) 2018-12-07 11:14:01 +01:00
irengrig d6d2f0761a
Adapt to the new Starlark API. (#157)
The rule supports both old and new API;
however, for switching the implementations, I had to use code generation - copying the actual implementations for different API variants into a generated repository.
I did not invent any other mechanics to deal with non existing top level symbols like CcInfo or CcCompilationInfo.

Design document about the new API: https://github.com/bazelbuild/proposals, Partial C++ Starlark API
Introduced in the commit: eb139371c9
2018-11-27 10:06:23 +01:00
irengrig 5a92ec4444
README: update information on Bazel version, + small cleanup. (#122) 2018-10-04 14:02:41 +02:00
irengrig 7f3663016d
Update README file with information about usage on Windows (#103) 2018-09-17 14:14:34 +02:00
irengrig 3aecf1c664
update readme file and framework rule comments (#78) 2018-08-31 14:23:16 +02:00
irengrig e418a1555b
Update README with information on how to correctly use rule (#23)
fixes https://github.com/bazelbuild/rules_foreign_cc/issues/12
2018-08-13 15:18:14 +02:00
irengrig 86a0d34a98
update README: new --experimental_cc_skylark_api_enabled_packages value (#10) 2018-08-08 16:49:35 +02:00
irengrig 14d64106fa
update README file; promote cmake_external, configure is not ready yet (#9) 2018-08-06 15:24:46 +02:00