Commit Graph

160 Commits

Author SHA1 Message Date
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
James Sharpe c309ec1319
Enable testing on RBE (#525)
* Enable testing on RBE

* Attempting to fix ninja example on RBE

* Disable targets that aren't currently working on RBE
2021-03-09 13:28:28 -08: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
UebelAndre dc49c3716c
Added architecture documentation (#544) 2021-03-09 10:49:13 -08:00
UebelAndre 175b29c6f7
Renamed BUILD files to BUILD.bazel (#540)
* Renamed BUILD files to BUILD.bazel

* Ran Buildifier
2021-03-03 10:08:03 -08:00
UebelAndre fc8efbdf7d
Added `ninja` rule for building Ninja projects (#527)
* Added `ninja` rule for building Ninja projects

* Third party ninja example
2021-03-01 15:46:25 +00: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
James Sharpe 9a4435ecab
Attempt to catch shell script errors proactively with 'set -euo pipef… (#500)
* Attempt to catch shell script errors proactively with 'set -euo pipefail'

* Fix up uninitialised variable use

* Fix osx shell function

* Fix to unbound variable in windows commands
2021-02-16 11:55:48 -08:00
UebelAndre dfccdce2c9
Moved some additional examples into the examples directory (#509) 2021-02-16 08:13:25 -08:00
UebelAndre 689c96aaa7
Fetch prebuilt cmake and ninja binaries as registered default toolchains (#508)
* Added tooling for generating repositories for pre-built cmake and ninja binaries

* Generated toolchains

* Picked up fix

* Removed toolchains from http_archives and updated generator script

* Regenerated toolchains

* Updated cmake version

* Added additional constraints

* Added option for registering preinstalled toolchains

* MacOS uses universal binaries

* Fixed typo

* More constraints
2021-02-16 15:41:58 +00:00
James Sharpe f77a9e12a3
Propagate defines into CFLAGS and CXXFLAGS passed to the framework (#498)
* Propagate defines into CFLAGS and CXXFLAGS passed to the framework

* Fix flags test

* Add example to test propagation of defines
2021-02-09 12:56:20 -08:00
Daniel Wagner-Hall ece188f9ab
Allow setting env vars (#489)
* Allow setting env vars

Also, bring all runfiles of data deps along for execution - currently
data deps which consist of more than one file aren't copied into the
action, which means that they will fail at runtime when they try to use
their runfiles.

* Update docs
2021-02-04 11:59:01 +00:00
UebelAndre 743975a998
Fixed incorrect detection of lib_source root (#488)
* Cleanup

* Fixed incorrect detection of lib_source root

* Updated tests
2021-02-03 20:18:43 +00:00
UebelAndre 14520d220f
Made buildifier checks more aggressive (#485)
* Made buildifier checks more aggressive

* Ran buildifier to fix all warnings

* Added sorting to cmake script generation and updated tests
2021-02-02 20:09:33 +00:00
Yun Peng 8ae4651929
Fix test target on macOS with Bazel@HEAD (#475)
* Fix test target on macOS with Bazel@HEAD

supports_dynamic_linker feature was removed from cc toolchain for macOS,
cc_binary should be used to build shared library.

Context: bazelbuild/bazel#4341 (comment)

* Fix test on Windows
2021-01-26 17:03:09 +00:00
UebelAndre 898bed4efb
Enable Buildifier in CI (#458)
* Added Buildifier check to CI

* Addressed Buildifier lint defects
2021-01-25 22:01:43 +00:00
UebelAndre d85b575a40
Remove deprecated rules_foreign_cc_utils repo (#470)
* Removed foreign_cc_platform_utils

* Removed rules_foreign_cc_bazel_version

* Update workspace_definitions.bzl

Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
2021-01-25 13:42:14 -08:00
UebelAndre 9b6a8f675c
Add tests for checking the minimum supported version to CI (#469) 2021-01-25 19:07:05 +00:00
UebelAndre 08e8c6c93d
Moved example dependencies into loadable bzl files (#467)
* Sorted dependencies

* Added rules_android repository to satisfy buildifier defects

* Added rules_cc repository to satisfy buildifier defects

* Ran Buildifier
2021-01-25 08:04:52 -08:00
UebelAndre 76870e532d
Updated uses of `@bazel_tools//src/conditions` to `@platforms//` (#465)
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
2021-01-25 08:01:46 -08:00
UebelAndre c18be7037a
Added `data` attr to common framework (#461)
* Added `data` attribute for files needed by the rule at runtime.

* Updated documentation

* Added examples

* Enable runfiles on windows

* Also gather transitive runfiles
2021-01-25 07:44:44 -08: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
Attila Oláh ec690c5075
Replace references to @bazel_tools//platforms with @platforms//. (#427)
The former has been deprecated and will break by
--incompatible_use_platforms_repo_for_constraints, as announced in
https://github.com/bazelbuild/bazel/issues/8622.

Fixes #354.

Co-authored-by: UebelAndre <andre.brisco@gmail.com>
2021-01-23 12:28:38 -08:00
Attila Oláh b1600aa05a
Update GMP to 6.2.1. Fixes #462. (#463)
Version 6.2.0 is gone from gmplib.org.

Also update extension to `.xz`, apparently `.gz` files are no longer
being distributed.
2021-01-23 15:08:17 +00:00
UebelAndre 2dbd5fc2c2
Moved documenting comments into `doc` fields (#460)
* Moved documentation comments to `doc` fields

* Updated docs example
2021-01-22 14:32:28 +00:00
UebelAndre fafbef3eca
Added bzl_libraries for stardoc support (#453)
There's now a top level bzl_library @rules_foreign_cc//:bzl_srcs that contain the .bzl sources for the build rules defined in this repo.

Stardoc support was also added to ensure the bzl_library structure is correct and usable outside of the repo. In addition to this, new documentation can be generated by running bazel run //docs:generate_docs from the root of rules_foreign_cc/examples to output @rules_foreign_cc_tests//docs:README.md.
2021-01-22 14:25:49 +00: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
c-parsons 9eb30f8c5a
Update mpfr to 4.1.0 (#420)
mpfr no longer supports 4.0.2 on the official site, so BazelCI was failing.
2020-07-13 16:41:03 +02:00
Justin King aeb5a4e35d
Support running autogen.sh and autoreconf (#403)
Co-authored-by: Justin King <jcking@google.com>
2020-06-08 19:01:21 +02:00
irengrig 74b146dc87
Fix shell function symlink_contents_to_dir, add test (#377)
Fix shell function symlink_contents_to_dir, add test

- test for the case when we symlink the contents of two directories with the same inner directories (include)
- the test data of the test for shell script helper also changes, as it uses the real shell toolchain implementation text
- Fixes the issue from #330
2020-05-08 11:43:40 +02:00
irengrig c86401f4ea
Use preinstalled CMake in tests on Mac OS (#399)
(merging without review because it only changes how the tests are run)
2020-05-07 20:38:21 +02:00
Laurent Le Brun c292369597
Fix Buildifier warnings (#395)
* Run buildifier formatter

* Fix buildifier warnings

Ran: `buildifier --lint=fix -r .`
2020-05-04 19:50:45 +02:00
irengrig 3515b20a24
Fix shell_script_helper.bzl to replace function calls inside function… (#375)
Fix shell_script_helper.bzl to replace function calls inside function texts.

Add test for shell_script_helper.bzl.
In particular, this fixes the case when some of the shell toolchain functions calls other shell toolchain functions (symlink_contents_to_dir and symlink_to_dir).
2020-04-30 11:24:25 +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 8b477ca9cb
Fix Visual Studio version used in examples for #368 (#370) 2020-02-13 10:26:42 +01:00
Simon Newton ed3db61a55 Fix the simple_make example so that it works on Mac & Linux (#339)
Fix the simple_make example so that it works on Mac and Debian and add it to Mac tests.
2019-11-26 19:13:54 +01:00
Philipp Wollermann 14b79e5a04 Mirror all http_archives. (#341)
Context: https://github.com/bazelbuild/bazel/issues/10270
2019-11-19 14:50:33 +01:00
irengrig c7fe8ce542
Lua example (#291)
Add an example for building https://github.com/LuaJIT/LuaJIT
2019-10-23 12:17:16 +02:00
irengrig 16ddc00bd4
Be resilient with Bazel-built transitive dependencies duplicates (#318)
Be resilient with Bazel-built transitive dependencies duplicates

- it is possible that some duplicate libraries, built with Bazel, will be passed as inputs to cmake_external or configure_make. rules_foreign_cc should filter duplicates out rather then fail.
- add a test (which just builds the target) //cmake_synthetic:lib_with_duplicate_transitive_bazel_deps
2019-09-17 14:34:20 -04:00
irengrig 6ad84f7739
Adapt rules_foreign_cc for working with libtool instead of ar. (#315)
Adapt rules_foreign_cc for working with libtool instead of ar.

- for CMake, pass "<TARGET>" as the output file when forming linker flags with cc_common. CMake will later replace <TARGET> with the actual output file. Fill CMAKE_C_CREATE_ARCHIVE and CMAKE_CXX_CREATE_ARCHIVE CMake variables with 'CMAKE_AR %Bazel-link-flags% <OBJECTS>' call, where CMAKE_AR will take the path to libtool.
Related documentation: https://cmake.org/cmake/help/v3.15/variable/CMAKE_LANG_ARCHIVE_CREATE.html?highlight=cmake_%20lang%20_archive_create

- for configure_make, for the libevent example, we need to skip specifying the libtool from Bazel's toolchain as a linker, because libevent script uses it's own libtool and manages to pass the output file to it, but not to the libtool we are passing. Let it do so as it is a customized script.
Do it with specifying empty string for the $AR environment variable.
Other examples with configure_make work fine.

This fixes https://github.com/bazelbuild/bazel/issues/9258
2019-09-09 18:20:42 +02:00
irengrig a209b642c7
Remove unnecessary restrictions on the library filename - fixes #276 (#294)
* Remove unnecessary restrictions on the library filename - fixes #276

* Fix review comments, remove unnecessary parameter
2019-07-17 14:05:03 +02:00
Keith Smiley ec8400cbd0 Switch to rules_jvm_external (#287)
The previous gmaven_rules usage was broken, this is the new supported
way to download these dependencies.
2019-07-10 18:44:57 +02:00
irengrig 540253c265
Implement support for "pure" GNU Make in make.bzl (#285)
* Implement support for "pure" GNU Make in make.bzl

Usage: load("@rules_foreign_cc//tools/build_defs:make.bzl", "make")
make(name = <name>, lib_source = <source>), please see more arguments
in make.bzl

Add test in examples/simple_make (runs only on Linux because of Makefile contents)
2019-07-10 18:05:24 +02:00
Michal Rostecki 8ccd83504b Minor fixes in example files (#264)
* examples: cmake_crosstool: Remove executable bit from BUILD

There is no reason for BUILD file to be an executable.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>

* examples: Add shebang to the bash script

print_bazel_version.sh is a bash script, but it did not contain a
shebang.

Signed-off-by: Michal Rostecki <mrostecki@opensuse.org>
2019-06-25 18:38:25 +02:00
irengrig 0b8356f199
Fix replace_in_files function in windows_commands.bzl (#280)
* Fix replace_in_files function in windows_commands.bzl

Filter files by types, where the absolute paths need to be replaced.

* Add one more hello world example

* Include test into windows list, remove from Mac OS list
2019-06-25 18:31:21 +02:00
irengrig dea1437d92
Fix #123 Improve code readability for collecting input dependencies (#257)
* Fix #123 Improve code readability for collecting input dependencies

* Fix line endings
2019-06-19 15:50:58 +02:00
Yun Peng 0f0c0da3a1 Fix patch file for nghttp2 (#275)
The line number doesn't match the exact location of the position of the content. This is tolerable with patch command line tool, but it won't work with a more strict patch implementation.
Context: https://github.com/bazelbuild/bazel/pulls
2019-06-06 13:25:46 +02:00
László Csomor 9cfeff53b5 Windows: tests now work with native test wrapper (#263)
Windows: tests now work with native test wrapper

See https://github.com/bazelbuild/bazel/issues/6622
2019-05-17 11:52:28 +02:00
irengrig e36f3cee8c
Fix using Bazel-built libraries by cmake_external and configure_make (#249)
Fix #232 - enable usage of Bazel-built libraries as dependencies of cmake_external and configure_make.

- fix logic of reading library data described by C/C++ Bazel interface (as CcInfo.linking_context appeared)
- symlink transitive include directories under $EXT_BUILD_DEPS
- gather all possible transitive include directories to pass to CMake, pass transitive include directories to CMAKE_PREFIX_PATH so that the transitive include directories were scanned by CMake
- fix logic of passing transitive libraries into CPPFLAGS (configure_make)
- add test with the chain: Bazel lib -> CMake lib -> Bazel cc_test
- add synthetic configure-make test with the chain: Bazel lib -> configure_make lib -> Bazel cc_test
- also notice, that passed include directories from Bazel C/C++ Sandwich interface are not always existing; for now, make symlinking code resistant to that

see https://www.gnu.org/software/autoconf/manual/autoconf-2.63/html_node/Preset-Output-Variables.html
2019-05-09 10:35:00 +02:00
irengrig 6b04da2262
Example with malloc attribute, currently not working (#250) 2019-05-07 18:19:16 +02:00
irengrig 4c59d4d0c5
Correct environment variable references to the platform-independent style (#248)
* working example for #241

* correct variables references
2019-05-06 16:30:21 +02:00
irengrig 15aec187ff
working example for #241 (#247) 2019-05-06 16:04:47 +02:00
László Csomor 5f9879c7ec Windows, tests: fix for native test wrapper (#246)
* Windows, tests: fix for native test wrapper

In this PR:

- Update `@bazel_skylib` to 0.8.0, which has a
  Windows-compatible unittest.bzl

- Fix unittest-using tests. Correct usage of
  `unittest.end(env)` is to return its value.

Result: //test:all now passes with Bazel 0.25.0rc3
and --incompatible_windows_native_test_wrapper

* Register Skylib toolchains

* rules_foreign_cc_dep registers unittest toolchains

* Address review comments

* Add bazel_skylib_workspace to WORKSPACE files

* Remove stale toolchain init code
2019-04-30 16:50:26 +03:00
Jingwen d18d7bd35d Fix Buildkite breakage caused by gmaven_rules rename (#236)
* Fix buildkite breakage

* update examples WORKSPACE
2019-03-12 15:41:04 +01: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
bbarnes52 514cb4e0a1 adds bootstrap_options to attribute to allow user to pass command line args to bootstrap.sh (#181) 2019-02-14 11:05:10 +01:00
irengrig b207809dba
Correction for what tests to run on CI on Windows with Bazel 0.22.0 (#207)
As Bazel 0.22.0 is broken for rules_foreign_cc on Windows, we do not want to run any tests with this version on CI. So we are selecting the list of tests to run according to recorded-in-workspace Bazel version.
But list of tests can not be empty! Instead, have a test that just prints the Bazel version.
2019-01-29 14:21:31 +01:00
irengrig 8c019a368f
Add bison/yacc example (configure & make) (#206)
For MAC/Linux
2019-01-28 22:10:31 +01:00
irengrig 5511d9e1fe
Launch at least some Windows tests on CI (#201)
All custom tools (MS Visual Studio) information goes into
windows_commands.bzl
2019-01-18 18:43:37 +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 fcd01e4a23
Fix reference to environment variables in examples, (#199)
provide more hints for configure-make example
2019-01-10 15:51:27 +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 006d5f6f8b
Reorganize examples to be in a separate workspace (#188)
* Reorganize examples to be in a separate workspace

This will help to define native tools toolchains for examples

* Remove examples-related part from main WORKSPACE file

* Copy .bazelrc to the examples workspace.

* correction for Bazel HEAD compatibility

* Changes to run nested workspace tests from main workspace
2019-01-07 10:31:27 +01:00
irengrig 8ec19f3959
Fix build, remove configure-make failing on CI, ubuntu 16 (#179) 2018-12-16 20:57:23 +01:00
irengrig 888a8a67e8
Add example how to produce binaries with configure_make (#178) 2018-12-16 11:35:52 +01:00
irengrig b08610b154
Improve the boost rule including user_options attribute. (#177)
* Improve the boost rule including user_options attribute.

Then --with-<library> parameter can be passed to build only that library
Modify examples to demonstrate how to use it.
However, building examples takes too long time, so do not include them into the tests.
2018-12-07 14:30:41 +01:00
irengrig 5d1cecfa08
Switch libevent example to configure_make implementation. (#175) 2018-12-06 20:11:13 +01:00
irengrig 9a261f7993
Crosstool example + fixes (#174)
* Add crosstool example; does not work with cmake rule yet

the code is taken from Bazel test data (bazel_toolchain_test_data)

* Make crosstool compilation of cmake_external + cc_binary work

To build example, cd examples/cmake_crosstool bazel build //:libhello_test

Changes:
1) Initially suggested in #124: put $EXT_BUILD_ROOT on path, so that relative paths can be resolved by CMake
2) Toolchain tools are references as relative paths, and they themselves refer to external repository with external/ prefix.
This will not work with CMake, as CMake also perform compiler tests and the build is performed in some temp directory.
We need to convert to absolute paths.
I did a trick with checking of $EXT_BUILD_ROOT is defined and then using it as a prefix.
3) I had to change the visibility of the cc-compiler-k8 toolchain to public
4) For CMake crosstool file, CMAKE_C_COMPILER, CMAKE_CXX_COMPILER, CMAKE_AR need to be absolute, so in cases when they are relative and not under external directory, force paths conversion
2018-12-06 18:14:00 +01:00
irengrig d39887d3d6
Do not run configure-make test on mac ci machines for now (#169)
Do not run configure-make test on mac ci machines for now
2018-12-04 18:54:21 +01:00
irengrig c82068dd2d
Correct the reference in Android example (#164) 2018-12-03 11:19:46 +01:00
irengrig 13419882d6
Put each of binary files into OutputGroupInfo under its name. (#148)
Add CMake test for building a binary and using that binary in a test.
2018-10-25 16:28:43 +02:00
irengrig c28320b89d
rename hello world examples (#146) 2018-10-25 12:56:42 +02:00
irengrig b3552bfef8
Fix dynamic libraries (#141)
* move cmake_hello example with static library into a subdirectory

* Fix #139; correct arguments to create_library_to_link

However, the test (which should link the externally built shared library to the calling .c file) fails with assertion that the .so file is in a "wrong" directory, so I am providing it here for additional work [possibly] on Bazel side; and I do not include it into the tests list

* As cc_common.create_library_to_link is now broken for shared libraries,
use the "old" variant cc_common.create_symlink_library_to_link.

As it will later be removed (and create_library_to_link fixed),
it is safe to check for the existence of create_symlink_library_to_link and call it.

Now the test with shared library built by CMake runs, so add it ot the [non-Windows, for now] suite.

* Adapt building shared library with cmake test for mac

* increment version

* Add comment on CMAKE_MACOSX_RPATH
2018-10-23 16:49:20 +02:00
irengrig 4965090335
External C/C++ libraries rules need to pass transitive info (#112)
* External C/C++ libraries rules need to pass transitive info

- to have the same interface as cc_library to hide the "implementation details",
so that the information about the install directory and its contents of non-direct external dependencies of external library was available for external build
- this is particularly needed for configure-make rule, where we do not control the way needed libraries are found, so we want to provide the install directory and the -L, -I flags (include and library directories to be searched) consistently,
pointing to the directories under $EXT_BUILD_DEPS
- as a side effect, *.la files that contained links to absolute paths of dependencies (pointing somewhere under ...sandbox/bazel-out/...) now will point to directories under $EXT_BUILD_DEPS and so will be replaced correctly/will not point to paths under the previous sandbox

* External C/C++ libraries rules need to pass transitive info [improve]
By review comments;

- rename to do not collate with internally reserved list, dir, provider
- rename providers to use the same "foreign_cc" prefix and be shorter
- improve providers description
- return back output groups to do not reduce the flexibility

* External C/C++ libraries rules need to pass transitive info [improve]
By review comments:

- some more renames

* External C/C++ libraries rules need to pass transitive info: version++

* Correct review comments
2018-10-05 22:04:54 +02:00
irengrig c7d13b34e5
Give libgd configure hints with directory paths (#111) 2018-09-21 11:56:24 +02:00
irengrig e1c3ce3ef5
Adjust configure-make: also replace absolute paths in -config files (#109)
+ assert libz, freetype, libpng to be found by configure for libgd
2018-09-21 10:57:02 +02:00
irengrig 29f66a98cd
Correct bugs and make configure-make work on MacOS (#108)
* correct shell utilities: params differ on mac, remove debug print,

+ correct a bug on windows

* Simplify the example, libz is also needed by libgd

* Framework function: simplify code gathering deps, collect_libs public

* Correct configure-make: get all lib files, also built with bazel

and pass them in LDFLAGS; correct the linking paths (add prefix)

* Make maximum line length for shell = 80

* Improve comments to the _InputFiles provider
2018-09-20 20:19:38 +02:00
irengrig aba303eb2a
Make configure-make examples into tests and include into the test list (#107) 2018-09-18 13:44:33 +02:00
irengrig 7d3bdc7e95
Add configure_make rule with zlib, freetype, libpng, libgd examples (#106)
+ fix replacement of the absolute paths in linked directories,
replace only in .pc files for speed
2018-09-18 13:20:58 +02:00
irengrig 4c27a2bb9d
Exclude synthetic tests from Ubuntu 16 on CI (#102)
Their main target is Windows
2018-09-14 15:37:00 +02:00
irengrig ace688c521
Synthetic tests: generate CMake crosstool file only on windows (#101) 2018-09-14 12:45:42 +02:00
irengrig b69aec07b6
Allow synthetic test on Windows (#97) 2018-09-14 10:24:10 +02:00
irengrig 64de227420
Adapt tests for Windows: set .a library name, use crosstool file (#95)
- On Linux, lib is added to the name
- Use CMake crosstool file (needed for Windows)
2018-09-14 10:10:39 +02:00
irengrig 242e932c60
Add CMake synthetic test with two libraries and cc_test (#93) 2018-09-13 14:34:55 +02:00
irengrig 9de19b91fe
Add Windows tests to the list (#91) 2018-09-12 15:41:19 +02:00
irengrig 913f437994
Windows tests: each library should be in a separate directory (#90) 2018-09-12 15:37:12 +02:00
irengrig 169cdca87b
More corrections for building on Windows (#89)
* Get cc_toolchain environment variables also for linking

* Correct environment setup

* Add Windows tests for Ninja and NMake generators
2018-09-12 15:20:31 +02:00
irengrig 86ea154cd9
More windows tests corrections (#87)
* Use rlocation for artifact paths in the test shell scripts

* CMake text tests: split into lines to be good with line separators
2018-09-11 13:55:25 +02:00
irengrig 10ab431c38
Modify hello world example with CMake to build on Windows (#86)
- with MSBuild generator (the path to it should be on the PATH)
- use CMake crosstool file
2018-09-11 13:07:11 +02:00
irengrig 3547a24075
Correct dependency on Ninja: do not depend on ninja if it is local (#84)
Also, provide a variable to put into dependencies, empty in case local ninja is installed, or containing the reference to ninja target
2018-09-10 11:54:59 +02:00
bbarnes52 9949b17fe2 implements pcl cmake_external build rule (#68)
* implements pcl cmake_external build rule

* Improve example with building PCL (Point Cloud Library):

- build boost library and use it as dependency
- add/correct some properties

* implements pcl cmake_external build rule

* Improve example with building PCL (Point Cloud Library):

- build boost library and use it as dependency
- add/correct some properties
2018-09-05 22:24:41 +02:00
irengrig 6f81b6e39e
fix #75 "trying to mutate a frozen object" (#79) 2018-08-31 20:11:12 +02:00
irengrig 8ef43c6f3c
make cmake and ninja build rules be available from util repository (#72) 2018-08-30 17:31:02 +02:00
irengrig 515c15a392
Add a feature of generating CMake toolchain file and writing tools and flags information there (#70)
* cmake toolchain files support

* extract cmake script consruction code into a separate file

for further testing

* simplify cmake script creation code

* first four tests for CMake script creation functions

* + move_dict_values_test for CMake script creation functions

* + reverse_descriptor_dict_test for CMake script creation functions

* + toolchain_and_user_values_test for CMake script creation functions

* add create_cmake_script_no_toolchain_file_test for CMake script creation

* do not insert executable linker rule option if it uses cxx compiler

since it would be the same as default
add one more test for command line

* add test for cmake script with toolchain file

* add test for cmake script with toolchain file with user values

* propagate information about target into CMake toolchain file
2018-08-30 13:12:51 +02:00
irengrig af0871023c
updte example to show out_include_dir usage (#61) 2018-08-24 11:28:34 +02:00
irengrig b382ac435e
add pcl library targets - not ready yet (#59)
more dependencies need to be provided
2018-08-22 22:30:29 +02:00
irengrig d4880f8fac
build cmake if it is missing (should be configurable) (#57) 2018-08-22 22:06:37 +02:00
irengrig cefeeaf82d
add nghttp2 example with test (#51) 2018-08-22 10:22:56 +02:00