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.
* 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>
* 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