@@ -26,12 +26,16 @@ def __init__(
26
26
path : str | None ,
27
27
rebuild : bool ,
28
28
verbose : bool ,
29
+ build_options : list [str ],
30
+ install_options : list [str ],
29
31
):
30
32
self .known_source_files = known_source_files
31
33
self .known_wheel_files = known_wheel_files
32
34
self .path = path
33
35
self .rebuild_flag = rebuild
34
36
self .verbose = verbose
37
+ self .build_options = build_options
38
+ self .install_options = install_options
35
39
36
40
def find_spec (
37
41
self ,
@@ -71,7 +75,7 @@ def rebuild(self) -> None:
71
75
print (f"Running cmake --build & --install in { self .path } " ) # noqa: T201
72
76
73
77
result = subprocess .run (
74
- ["cmake" , "--build" , "." ],
78
+ ["cmake" , "--build" , "." , * self . build_options ],
75
79
cwd = self .path ,
76
80
stdout = sys .stderr if verbose else subprocess .PIPE ,
77
81
env = env ,
@@ -86,7 +90,7 @@ def rebuild(self) -> None:
86
90
result .check_returncode ()
87
91
88
92
result = subprocess .run (
89
- ["cmake" , "--install" , "." , "--prefix" , DIR ],
93
+ ["cmake" , "--install" , "." , "--prefix" , DIR , * self . install_options ],
90
94
cwd = self .path ,
91
95
stdout = sys .stderr if verbose else subprocess .PIPE ,
92
96
env = env ,
@@ -107,6 +111,8 @@ def install(
107
111
path : str | None ,
108
112
rebuild : bool = False ,
109
113
verbose : bool = False ,
114
+ build_options : list [str ] | None = None ,
115
+ install_options : list [str ] | None = None ,
110
116
) -> None :
111
117
"""
112
118
Install a meta path finder that redirects imports to the source files, and
@@ -121,6 +127,12 @@ def install(
121
127
sys .meta_path .insert (
122
128
0 ,
123
129
ScikitBuildRedirectingFinder (
124
- known_source_files , known_wheel_files , path , rebuild , verbose
130
+ known_source_files ,
131
+ known_wheel_files ,
132
+ path ,
133
+ rebuild ,
134
+ verbose ,
135
+ build_options or [],
136
+ install_options or [],
125
137
),
126
138
)
0 commit comments