2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-12-03 02:52:58 +00:00
Commit graph

171 commits

Author SHA1 Message Date
irengrig 348628d18b
Add test for #163 (do not strip quotes when merging flag values) (#167) 2018-12-04 16:08:30 +01:00
bbarnes52 6caaa8a26b removes strip calls from string concatenation to fix bug where compiler invocation failed due to invalid syntax (#163) 2018-12-04 16:02:00 +01:00
irengrig 7fdfc7cade
When cmake_external script fails, do not delete build directory. (#166)
* When cmake_external script fails, do not delete build directory.

Fixes #162.
2018-12-04 14:32:59 +01:00
irengrig c82068dd2d
Correct the reference in Android example (#164) 2018-12-03 11:19:46 +01:00
irengrig 59bd073a22
In the generated repository, refer to the "parent" as @rules_foreign_cc (#161)
Fixes #160
2018-11-29 21:55:27 +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
bbarnes52 bf2cb0112c adds *.cmake as regex to be searched by replace_in_files (#156) 2018-11-16 22:30:04 +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 d9318f13d3
framework: extract environment variable declaration into separate part (#145) 2018-10-25 12:37:15 +02:00
irengrig dee42b1598
Correct the problem with dependent output files/directories (#138)
* Correct the problem with dependent output files/directories

A rule should not return files and their parent directory;
therefore, create a copy directory for the install directory, which we use in the next-step external builds, and reduce other outputs to the lowest level (library files, binary files, include directories).

* Correct review comments: add documentation, revert not related change.

* Do not pass the rule context as argument into shell utilities functions;

only pass the actions factory and other specific parameters.
(review comments)
2018-10-25 11:53:58 +02:00
bbarnes52 8026d6f5ce minor code cleanup (#144) 2018-10-25 11:30:25 +02:00
bbarnes52 2fc3d7b847 removes directories from output declarations to enable remote execution (#133)
* removes directories from output declarations to enable remote execution

* incorporates @irengrigs feedback
2018-10-25 11:24:44 +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 1fc6063498
Fix mac os copying functions (#142) 2018-10-23 16:39:25 +02:00
bbarnes52 5373e59a65 fixes boost (#136)
* fixes boost rule

* fixes boost

* updates to use configureParameters
2018-10-19 18:49:30 +02:00
irengrig eabe5f09d4
Simplify shell utils: remove unused methods, use --no-target-directory (#140)
.. for directory contents copying
2018-10-19 10:50:40 +02:00
irengrig 30ecb0d59e
Fix binary outputs declaration (#131) 2018-10-15 11:05:52 -04:00
irengrig ce306646d0
Improve documentation and naming for the configuration callback (#130)
- create provider for the parameters, passed to the callback
- correct documentation
2018-10-15 11:00:52 -04:00
irengrig 944399982f
Fix getting ForeignCcDeps from deps, it is optional provider (#129) 2018-10-15 07:23:03 -04: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 5a92ec4444
README: update information on Bazel version, + small cleanup. (#122) 2018-10-04 14:02:41 +02:00
irengrig c5cd4bd01f
Remove incorrect merging of the linkopts (#121) 2018-10-04 13:40:30 +02:00
irengrig 0d5f5c2da7
Replace cc_common.create_symlink_library_to_link calls (#117)
... with cc_common.create_library_to_link
2018-10-02 12:39:58 +02:00
irengrig c7d13b34e5
Give libgd configure hints with directory paths (#111) 2018-09-21 11:56:24 +02:00
irengrig 97d6cfee0c
Print version information by the script (#110) 2018-09-21 11:48:39 +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 d4c55bb51e
Refactor framework function: configure_script to be a callback (#104)
reason: configure-make should reuse the linking and compilation structures created by framework function
2018-09-17 14:27:35 +02:00
irengrig 7f3663016d
Update README file with information about usage on Windows (#103) 2018-09-17 14:14:34 +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 94d95ec85b
Make deps directory be called differently for each library (#100)
otherwise during test execution too much is accumulated in that same directory,
and CMake gives up after searching in some amount of that subdirectories, and tests blink
2018-09-14 11:56:53 +02:00
irengrig af3f3e0618
Mac OS: Pass environment variables to run_shell, not in the script (#99)
for the DEVELOPER_DIRECTORY to be calculated
2018-09-14 11:20:02 +02:00
irengrig fc29335572
Do not convert depset to list for iteration (#98) 2018-09-14 10:40:38 +02:00
irengrig b69aec07b6
Allow synthetic test on Windows (#97) 2018-09-14 10:24:10 +02:00
irengrig 8dca26ac29
Pass the value of --compilation_mode dbg to the rule and to CMake (#96)
CMAKE_BUILD_TYPE=DEBUG (otherwise RELEASE)
Can be overriden by user passing CMAKE_BUILD_TYPE in cache_entries
2018-09-14 10:18:38 +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 bd65563ae0
Correct copying on Windows: recursive flag (#94) 2018-09-14 10:04:25 +02:00
irengrig 242e932c60
Add CMake synthetic test with two libraries and cc_test (#93) 2018-09-13 14:34:55 +02:00
irengrig bc43624fc4
Fix the order of libraries in out linking info: first the current (#92)
Otherwise linking error about undefined symbol
2018-09-13 14:25:47 +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 0aab4e65c5
Win changes (#85)
* Allow execution on Windows, use utils_win.sh, copy instead of symlink

* Prepare for execution on Windows: set up environment, convert path

also rename TMPDIR since it can clash with widely used variable
2018-09-11 11:43:13 +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