File tree 3 files changed +29
-4
lines changed
3 files changed +29
-4
lines changed Original file line number Diff line number Diff line change @@ -24,3 +24,5 @@ build --incompatible_restrict_string_escapes=false
24
24
# parameter 'user_link_flags' is deprecated and will be removed soon.
25
25
# It may be temporarily re-enabled by setting --incompatible_require_linker_input_cc_api=false
26
26
build --incompatible_require_linker_input_cc_api=false
27
+ build:macos --apple_platform_type=macos
28
+ build:macos_arm64 --cpu=darwin_arm64
Original file line number Diff line number Diff line change 1
1
licenses (["notice" ]) # Apache 2.0
2
2
3
+ load ("@bazel_skylib//lib:selects.bzl" , "selects" )
4
+
3
5
package (default_visibility = ["//visibility:public" ])
4
6
5
7
config_setting (
@@ -10,9 +12,26 @@ config_setting(
10
12
)
11
13
12
14
config_setting (
15
+ name = "macos_x86_64" ,
16
+ values = {
17
+ "apple_platform_type" : "macos" ,
18
+ "cpu" : "darwin" ,
19
+ },
20
+ )
21
+
22
+ config_setting (
23
+ name = "macos_arm64" ,
24
+ values = {
25
+ "apple_platform_type" : "macos" ,
26
+ "cpu" : "darwin_arm64" ,
27
+ },
28
+ )
29
+
30
+ selects .config_setting_group (
13
31
name = "macos" ,
14
- constraint_values = [
15
- "@bazel_tools//platforms:osx" ,
32
+ match_any = [
33
+ ":macos_x86_64" ,
34
+ ":macos_arm64" ,
16
35
],
17
36
)
18
37
Original file line number Diff line number Diff line change @@ -91,8 +91,12 @@ def finalize_options(self):
91
91
'installation instruction.' )
92
92
self ._additional_build_options = []
93
93
if platform .system () == 'Darwin' :
94
- # Minimum macOS version 10.14 is needed to be compatible with c++17.
95
- self ._additional_build_options = ['--macos_minimum_os=10.14' ]
94
+ # This flag determines the platform qualifier of the macos wheel.
95
+ if platform .machine () == 'arm64' :
96
+ self ._additional_build_options = ['--macos_minimum_os=11.0' ,
97
+ '--config=macos_arm64' ]
98
+ else :
99
+ self ._additional_build_options = ['--macos_minimum_os=10.14' ]
96
100
97
101
def run (self ):
98
102
subprocess .check_call (
You can’t perform that action at this time.
0 commit comments