2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-29 12:33:51 +00:00
Commit graph

112 commits

Author SHA1 Message Date
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
irengrig b467afc40f
Correct "use default shell environment" action argument (#83)
We should take the default PATH passed by Bazel, not that from cc_toolchain for Windows, because the PATH under msys2 is different and that is which we need for shell commands
2018-09-10 11:34:43 +02:00
irengrig 06970670ae
Correct checking the shared library to also filter out empty values (#82) 2018-09-10 11:22:39 +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 3aecf1c664
update readme file and framework rule comments (#78) 2018-08-31 14:23:16 +02:00
irengrig f06338eafd
correct comment indent (#77) 2018-08-31 10:52:53 +02:00
irengrig bbb4bb8059
Merge CMAKE_PREFIX_PATH, passed by user, with $EXT_BUILD_DEPS (#76)
This allows using locally installed libraries to be found by CMake
+ test
2018-08-31 10:50:38 +02:00
irengrig 1b1de96220
Add comments (#74) 2018-08-30 18:32:03 +02:00
irengrig a34694a90a
do not use 'workspace' as top level package name (#73) 2018-08-30 18:08:44 +02:00