2
0
Fork 0
mirror of https://github.com/bazel-contrib/rules_foreign_cc synced 2024-11-30 16:42:07 +00:00
rules_foreign_cc/examples/built_ninja/test_ninja_version.sh
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

16 lines
337 B
Bash
Executable file

#!/usr/bin/env bash
if [ $1 == "true" ]; then
NINJA_COMMAND="./built_ninja/ninja/ninja"
else
NINJA_COMMAND="ninja"
fi
echo "Ninja command: $NINJA_COMMAND"
NINJA_VERSION=$(${NINJA_COMMAND} --version)
echo "Version: $NINJA_VERSION"
if [ "x$NINJA_VERSION" != "x1.8.2" ]; then
echo "Wrong ninja version: $NINJA_VERSION"
exit -1
fi