diff options
author | cpeyser <cpeyser@google.com> | 2017-08-29 18:06:54 +0200 |
---|---|---|
committer | Vladimir Moskva <vladmos@google.com> | 2017-08-29 18:53:02 +0200 |
commit | 9d5bce66280094c0531ddfde2752e596d0d78c79 (patch) | |
tree | 891675c9be45cd4a0a236ee4b1f41271bb1a5542 /tools/platforms | |
parent | 7876d97dbe7d4593855e62667fa7eba5774b561b (diff) |
Add a new toolchain type for c++. In order to do this, PlatformConfiguration is made a legal configuration fragment for every rule class.
Add a default "dummy" c++ toolchain to prevent resolution errors when legacy toolchain selection logic is used. Add toolchain mocks to java and shell tests.
PiperOrigin-RevId: 166854893
Diffstat (limited to 'tools/platforms')
-rw-r--r-- | tools/platforms/BUILD | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/tools/platforms/BUILD b/tools/platforms/BUILD index 4e788aea2c..1b74f106eb 100644 --- a/tools/platforms/BUILD +++ b/tools/platforms/BUILD @@ -13,3 +13,95 @@ filegroup( name = "srcs", srcs = glob(["**"]), ) + +# These match values in //src/main/java/com/google/build/lib/util:CPU.java +constraint_setting(name = "cpu") + +constraint_value( + name = "x86_32", + constraint_setting = ":cpu", +) + +constraint_value( + name = "x86_64", + constraint_setting = ":cpu", +) + +constraint_value( + name = "ppc", + constraint_setting = ":cpu", +) + +constraint_value( + name = "arm", + constraint_setting = ":cpu", +) + +constraint_value( + name = "s390x", + constraint_setting = ":cpu", +) + +# These match values in //src/main/java/com/google/build/lib/util:OS.java +constraint_setting(name = "os") + +constraint_value( + name = "osx", + constraint_setting = ":os", +) + +constraint_value( + name = "freebsd", + constraint_setting = ":os", +) + +constraint_value( + name = "linux", + constraint_setting = ":os", +) + +constraint_value( + name = "windows", + constraint_setting = ":os", +) + +# A default platform with nothing defined. +platform(name = "default_platform") + +# A default platform referring to the host system. This only exists for +# internal build configurations, and so shouldn't be accessed by other packages. +platform( + name = "host_platform", + cpu_constraints = [ + ":x86_32", + ":x86_64", + ":ppc", + ":arm", + ":s390x", + ], + host_platform = True, + os_constraints = [ + ":osx", + ":freebsd", + ":linux", + ":windows", + ], +) + +platform( + name = "target_platform", + cpu_constraints = [ + ":x86_32", + ":x86_64", + ":ppc", + ":arm", + ":s390x", + ], + os_constraints = [ + ":osx", + ":freebsd", + ":linux", + ":windows", + ], + target_platform = True, +) |