2018-07-30 10:56:09 +00:00
|
|
|
workspace(name = "rules_foreign_cc")
|
|
|
|
|
2021-03-09 21:28:28 +00:00
|
|
|
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
2021-03-12 17:08:13 +00:00
|
|
|
load("//foreign_cc:repositories.bzl", "rules_foreign_cc_dependencies")
|
2018-07-30 10:56:09 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
rules_foreign_cc_dependencies()
|
2018-08-13 13:02:25 +00:00
|
|
|
|
2019-01-07 09:31:27 +00:00
|
|
|
local_repository(
|
2021-02-26 20:21:13 +00:00
|
|
|
name = "rules_foreign_cc_examples",
|
2019-01-07 09:31:27 +00:00
|
|
|
path = "examples",
|
|
|
|
)
|
|
|
|
|
2021-02-26 20:21:13 +00:00
|
|
|
load("@rules_foreign_cc_examples//deps:repositories.bzl", examples_repositories = "repositories")
|
2018-08-22 08:16:44 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
examples_repositories()
|
use tools paths and flags from the toolchain (#7)
* take tools paths and flags from the toolchain
* correct toolchain data extraction, correct cmake flags and environment
* framework script: export variables intended to be used in config script
config script can create child processes which could use this variables
* cmake: prepend relative [to the execroot] paths with "$EXT_BUILD_ROOT/"
unfortunately, CMake does not understand relative paths
(sometimes it runs tests for the passed compiler and for that
concatenates the passed relative path to some tmp directory created for test)
we replace only paths starting with external/ and <top-package-name>/,
so we are quite fine to not make a mistake with replacing some not related to paths text;
the targets for replacement take very different form (judging by examining
toolchain definitions), for instance "-Lexternal/something"
* test data for cross compilation for android and with --crosstool_top
data files taken from bazel examples and bazel test data;
NB one of the interesting things is that we need to specify tools dependency on android sdk and ndk, so that cmake_external shell script have access to these tools
* remove cross compilation example with CROSSTOOL for now
* add very simple CMake library (test data)
* rename target to indicate it is not a test, but example
* adjust android example:
rename the target to indicate it is not a test but example,
add android ndk sources as additional tool for cmake target,
(otherwise it is not available in sandbox)
use more simple cmake-built library
* corrections to the framework & cmake:
- correct search for the root directory of the filegroup (when it is not under external)
- it was a mistake to specify shared library linker, specify CMAKE_AR instead
- unfortunately, I have not discovered how to modify CMake behaviour to pass the custom static flags (rcsD) before "-qc <target>" to the ar linker; option from documentation does not work. To be investigated. For now, do not pass the static cxx linker options, taken from Bazel toolchain.
2018-08-06 13:23:18 +00:00
|
|
|
|
2021-02-26 20:21:13 +00:00
|
|
|
load("@rules_foreign_cc_examples//deps:deps_android.bzl", examples_deps_android = "deps_android")
|
2020-05-04 17:50:45 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
examples_deps_android()
|
use tools paths and flags from the toolchain (#7)
* take tools paths and flags from the toolchain
* correct toolchain data extraction, correct cmake flags and environment
* framework script: export variables intended to be used in config script
config script can create child processes which could use this variables
* cmake: prepend relative [to the execroot] paths with "$EXT_BUILD_ROOT/"
unfortunately, CMake does not understand relative paths
(sometimes it runs tests for the passed compiler and for that
concatenates the passed relative path to some tmp directory created for test)
we replace only paths starting with external/ and <top-package-name>/,
so we are quite fine to not make a mistake with replacing some not related to paths text;
the targets for replacement take very different form (judging by examining
toolchain definitions), for instance "-Lexternal/something"
* test data for cross compilation for android and with --crosstool_top
data files taken from bazel examples and bazel test data;
NB one of the interesting things is that we need to specify tools dependency on android sdk and ndk, so that cmake_external shell script have access to these tools
* remove cross compilation example with CROSSTOOL for now
* add very simple CMake library (test data)
* rename target to indicate it is not a test, but example
* adjust android example:
rename the target to indicate it is not a test but example,
add android ndk sources as additional tool for cmake target,
(otherwise it is not available in sandbox)
use more simple cmake-built library
* corrections to the framework & cmake:
- correct search for the root directory of the filegroup (when it is not under external)
- it was a mistake to specify shared library linker, specify CMAKE_AR instead
- unfortunately, I have not discovered how to modify CMake behaviour to pass the custom static flags (rcsD) before "-qc <target>" to the ar linker; option from documentation does not work. To be investigated. For now, do not pass the static cxx linker options, taken from Bazel toolchain.
2018-08-06 13:23:18 +00:00
|
|
|
|
2021-02-26 20:21:13 +00:00
|
|
|
load("@rules_foreign_cc_examples//deps:deps_jvm_external.bzl", examples_deps_jvm_external = "deps_jvm_external")
|
use tools paths and flags from the toolchain (#7)
* take tools paths and flags from the toolchain
* correct toolchain data extraction, correct cmake flags and environment
* framework script: export variables intended to be used in config script
config script can create child processes which could use this variables
* cmake: prepend relative [to the execroot] paths with "$EXT_BUILD_ROOT/"
unfortunately, CMake does not understand relative paths
(sometimes it runs tests for the passed compiler and for that
concatenates the passed relative path to some tmp directory created for test)
we replace only paths starting with external/ and <top-package-name>/,
so we are quite fine to not make a mistake with replacing some not related to paths text;
the targets for replacement take very different form (judging by examining
toolchain definitions), for instance "-Lexternal/something"
* test data for cross compilation for android and with --crosstool_top
data files taken from bazel examples and bazel test data;
NB one of the interesting things is that we need to specify tools dependency on android sdk and ndk, so that cmake_external shell script have access to these tools
* remove cross compilation example with CROSSTOOL for now
* add very simple CMake library (test data)
* rename target to indicate it is not a test, but example
* adjust android example:
rename the target to indicate it is not a test but example,
add android ndk sources as additional tool for cmake target,
(otherwise it is not available in sandbox)
use more simple cmake-built library
* corrections to the framework & cmake:
- correct search for the root directory of the filegroup (when it is not under external)
- it was a mistake to specify shared library linker, specify CMAKE_AR instead
- unfortunately, I have not discovered how to modify CMake behaviour to pass the custom static flags (rcsD) before "-qc <target>" to the ar linker; option from documentation does not work. To be investigated. For now, do not pass the static cxx linker options, taken from Bazel toolchain.
2018-08-06 13:23:18 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
examples_deps_jvm_external()
|
2018-08-20 19:22:45 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
|
2018-08-20 19:22:45 +00:00
|
|
|
|
2021-01-25 16:04:52 +00:00
|
|
|
bazel_skylib_workspace()
|
2021-03-09 21:28:28 +00:00
|
|
|
|
|
|
|
http_archive(
|
|
|
|
name = "bazel_toolchains",
|
2021-05-21 18:40:34 +00:00
|
|
|
sha256 = "179ec02f809e86abf56356d8898c8bd74069f1bd7c56044050c2cd3d79d0e024",
|
|
|
|
strip_prefix = "bazel-toolchains-4.1.0",
|
2021-03-09 21:28:28 +00:00
|
|
|
urls = [
|
2021-05-21 18:40:34 +00:00
|
|
|
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
|
|
|
|
"https://github.com/bazelbuild/bazel-toolchains/releases/download/4.1.0/bazel-toolchains-4.1.0.tar.gz",
|
2021-03-09 21:28:28 +00:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
load("@bazel_toolchains//rules:rbe_repo.bzl", "rbe_autoconfig")
|
|
|
|
|
2021-05-21 18:40:34 +00:00
|
|
|
# Creates a default toolchain config for RBE.
|
|
|
|
# Use this as is if you are using the rbe_ubuntu16_04 container,
|
|
|
|
# otherwise refer to RBE docs.
|
2021-03-09 21:28:28 +00:00
|
|
|
rbe_autoconfig(name = "buildkite_config")
|