John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 1 | # Standard constraint_setting and constraint_values to be used in platforms. |
| 2 | |
| 3 | package( |
| 4 | default_visibility = ["//visibility:public"], |
| 5 | ) |
| 6 | |
ajmichael | a5bda13 | 2018-03-19 09:30:22 -0700 | [diff] [blame] | 7 | # These match values in //src/main/java/com/google/devtools/build/lib/util:CPU.java |
John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 8 | constraint_setting(name = "cpu") |
| 9 | |
| 10 | constraint_value( |
| 11 | name = "x86_32", |
| 12 | constraint_setting = ":cpu", |
| 13 | ) |
| 14 | |
| 15 | constraint_value( |
| 16 | name = "x86_64", |
| 17 | constraint_setting = ":cpu", |
| 18 | ) |
| 19 | |
| 20 | constraint_value( |
| 21 | name = "ppc", |
| 22 | constraint_setting = ":cpu", |
| 23 | ) |
| 24 | |
| 25 | constraint_value( |
| 26 | name = "arm", |
| 27 | constraint_setting = ":cpu", |
| 28 | ) |
| 29 | |
| 30 | constraint_value( |
Arielle Albon | 886d01c | 2018-06-20 05:51:18 -0700 | [diff] [blame] | 31 | name = "aarch64", |
| 32 | constraint_setting = ":cpu", |
| 33 | ) |
| 34 | |
| 35 | constraint_value( |
jcater | 227744a | 2017-06-05 15:25:09 -0400 | [diff] [blame] | 36 | name = "s390x", |
John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 37 | constraint_setting = ":cpu", |
| 38 | ) |
| 39 | |
ajmichael | a5bda13 | 2018-03-19 09:30:22 -0700 | [diff] [blame] | 40 | # These match values in //src/main/java/com/google/devtools/build/lib/util:OS.java |
John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 41 | constraint_setting(name = "os") |
| 42 | |
| 43 | constraint_value( |
| 44 | name = "osx", |
| 45 | constraint_setting = ":os", |
| 46 | ) |
| 47 | |
| 48 | constraint_value( |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 49 | name = "ios", |
| 50 | constraint_setting = ":os", |
| 51 | ) |
| 52 | |
| 53 | constraint_value( |
John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 54 | name = "freebsd", |
| 55 | constraint_setting = ":os", |
| 56 | ) |
| 57 | |
| 58 | constraint_value( |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 59 | name = "android", |
| 60 | constraint_setting = ":os", |
| 61 | ) |
| 62 | |
| 63 | constraint_value( |
John Cater | 58a8f07 | 2017-03-23 16:55:41 +0000 | [diff] [blame] | 64 | name = "linux", |
| 65 | constraint_setting = ":os", |
| 66 | ) |
| 67 | |
| 68 | constraint_value( |
| 69 | name = "windows", |
| 70 | constraint_setting = ":os", |
| 71 | ) |
John Cater | 0425b2d | 2017-06-07 12:06:10 -0400 | [diff] [blame] | 72 | |
| 73 | # A default platform with nothing defined. |
| 74 | platform(name = "default_platform") |
jcater | b6220e6 | 2017-06-20 21:22:58 +0200 | [diff] [blame] | 75 | |
| 76 | # A default platform referring to the host system. This only exists for |
| 77 | # internal build configurations, and so shouldn't be accessed by other packages. |
| 78 | platform( |
| 79 | name = "host_platform", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 80 | constraint_values = [ |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 81 | ], |
jcater | b6220e6 | 2017-06-20 21:22:58 +0200 | [diff] [blame] | 82 | cpu_constraints = [ |
| 83 | ":x86_32", |
| 84 | ":x86_64", |
| 85 | ":ppc", |
| 86 | ":arm", |
Arielle Albon | 886d01c | 2018-06-20 05:51:18 -0700 | [diff] [blame] | 87 | ":aarch64", |
jcater | b6220e6 | 2017-06-20 21:22:58 +0200 | [diff] [blame] | 88 | ":s390x", |
| 89 | ], |
| 90 | host_platform = True, |
| 91 | os_constraints = [ |
| 92 | ":osx", |
| 93 | ":freebsd", |
| 94 | ":linux", |
| 95 | ":windows", |
| 96 | ], |
| 97 | ) |
| 98 | |
| 99 | platform( |
| 100 | name = "target_platform", |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 101 | constraint_values = [ |
jcater | f5c8c0b | 2018-03-27 07:22:35 -0700 | [diff] [blame] | 102 | ], |
jcater | b6220e6 | 2017-06-20 21:22:58 +0200 | [diff] [blame] | 103 | cpu_constraints = [ |
| 104 | ":x86_32", |
| 105 | ":x86_64", |
| 106 | ":ppc", |
| 107 | ":arm", |
Arielle Albon | 886d01c | 2018-06-20 05:51:18 -0700 | [diff] [blame] | 108 | ":aarch64", |
jcater | b6220e6 | 2017-06-20 21:22:58 +0200 | [diff] [blame] | 109 | ":s390x", |
| 110 | ], |
| 111 | os_constraints = [ |
| 112 | ":osx", |
| 113 | ":freebsd", |
| 114 | ":linux", |
| 115 | ":windows", |
| 116 | ], |
| 117 | target_platform = True, |
| 118 | ) |