Fixes cross-compiling from macos to linux.
see #997 for background.
I had to make a couple of extra changes to support this:
Setting CMAKE_SYSTEM_NAME manually causes CMAKE_SYSTEM_PROCESSOR to not be set. This breaks some builds that expect this variable to be set like libjpeg-turbo.
I made it so that the above variables are only set when cross-compilation is detected so that rules_foreign_cc only takes on responsibility of setting them when necessary.
* 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>
* Fix tool_prefix for CMake.
Set the prefix before the first CMake invocation (where all the extra
flags are passed), and don't set the prefix for the `--build` and
`--install` invocations of CMake.
Fixes #685.
* Update test/cmake_text_tests.bzl
Co-authored-by: UebelAndre <github@uebelandre.com>
* Add config for building with spawn_strategy=standalone
* Always build RELEASE configuration to avoid having to select for the output due to change in artifact names for debug builds
* Fix for copy_contents_to_dir and symlink_contents_to_dir on macOS as per #512
* Update name of test files
* Added a new `platform_info` target to the foreign_cc framework
* Update foreign_cc/private/framework/platform.bzl
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
* Fix string escaping for cmake and configure/make
Use raw strings where possible to make readability slightly less maddening.
* Example usage of __TIME__
* Allow expansion of environment variables in HEREDOC for cmake crosstool
* Add compile check that __TIME__ is correctly redacted
* Ran buildifier
* Remove comment that is now invalid
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
* 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
* 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
* Build under bazel sandbox instead of /tmp, and remove redundant printf
Build artifacts under /tmp are not cleaned up after a failed build, for
the ease of debugging. However, this can quickly fill up the /tmp partition
if the build is large. Build under the sandbox directory instead, and
rely on standard bazel cleanup scheme.
Also remove a print from the cleanup function, which somehow causes empty
newlines to be printed in bazel build output.
* Avoid infinite recursion in symlink_to_dir.
This is a somewhat hackish approach to exclude *.ext_build_deps from
symlinks when creating the symlink forest. This is necessary in cases
where an entire directory is added to the includes, e.g. when setting
includes = ["."] where the directory itself contains a cmake_external()
rule that depends on the very rule containing the includes = ["."].
* Also avoid using a temp directory when bootstrapping make or cmake itself.
* Remove the ##tmpdir## shell toolchain command.
It is no longer necessary now that all its uses are gone.
Co-authored-by: Lauri Peltonen <lape@iki.fi>
handle filename containg space.
cmake prebuilt archive contains such filename in docs etc.
also fix symlink to a directory. [ -L "$1" ] returns success
for it, but it would fail "cp $1 $2" as
cp: -r not specified; omitting directory ...
Fixes: #405, #406
Co-authored-by: UebelAndre <andre.brisco@gmail.com>
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