@@ -26,12 +26,16 @@ def __init__(
2626 path : str | None ,
2727 rebuild : bool ,
2828 verbose : bool ,
29+ build_options : list [str ],
30+ install_options : list [str ],
2931 ):
3032 self .known_source_files = known_source_files
3133 self .known_wheel_files = known_wheel_files
3234 self .path = path
3335 self .rebuild_flag = rebuild
3436 self .verbose = verbose
37+ self .build_options = build_options
38+ self .install_options = install_options
3539
3640 def find_spec (
3741 self ,
@@ -71,7 +75,7 @@ def rebuild(self) -> None:
7175 print (f"Running cmake --build & --install in { self .path } " ) # noqa: T201
7276
7377 result = subprocess .run (
74- ["cmake" , "--build" , "." ],
78+ ["cmake" , "--build" , "." , * self . build_options ],
7579 cwd = self .path ,
7680 stdout = sys .stderr if verbose else subprocess .PIPE ,
7781 env = env ,
@@ -86,7 +90,7 @@ def rebuild(self) -> None:
8690 result .check_returncode ()
8791
8892 result = subprocess .run (
89- ["cmake" , "--install" , "." , "--prefix" , DIR ],
93+ ["cmake" , "--install" , "." , "--prefix" , DIR , * self . install_options ],
9094 cwd = self .path ,
9195 stdout = sys .stderr if verbose else subprocess .PIPE ,
9296 env = env ,
@@ -107,6 +111,8 @@ def install(
107111 path : str | None ,
108112 rebuild : bool = False ,
109113 verbose : bool = False ,
114+ build_options : list [str ] | None = None ,
115+ install_options : list [str ] | None = None ,
110116) -> None :
111117 """
112118 Install a meta path finder that redirects imports to the source files, and
@@ -121,6 +127,12 @@ def install(
121127 sys .meta_path .insert (
122128 0 ,
123129 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 [],
125137 ),
126138 )
0 commit comments