File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -170,6 +170,7 @@ def build_extension(self, ext):
170
170
os .mkdir (ext .build_dir )
171
171
172
172
build_type = 'Release'
173
+ use_ninja = False
173
174
174
175
if _check_env_flag ('DEBUG' ):
175
176
build_type = 'Debug'
@@ -193,6 +194,10 @@ def build_extension(self, ext):
193
194
if _check_env_flag ("DPCPP_ENABLE_PROFILING" ):
194
195
cmake_args += ['-DDPCPP_ENABLE_PROFILING=1' ]
195
196
197
+ if _check_env_flag ("USE_NINJA" ):
198
+ use_ninja = True
199
+ cmake_args += ['-GNinja' ]
200
+
196
201
build_args = ['-j' , str (multiprocessing .cpu_count ())]
197
202
198
203
env = os .environ .copy ()
@@ -203,7 +208,10 @@ def build_extension(self, ext):
203
208
check_call ([self .cmake , ext .project_dir ] + cmake_args , cwd = ext .build_dir , env = env )
204
209
205
210
# build_args += ['VERBOSE=1']
206
- check_call (['make' ] + build_args , cwd = ext .build_dir , env = env )
211
+ if use_ninja :
212
+ check_call (['ninja' ] + build_args , cwd = ext .build_dir , env = env )
213
+ else :
214
+ check_call (['make' ] + build_args , cwd = ext .build_dir , env = env )
207
215
208
216
209
217
ipex_git_sha , torch_git_sha = get_git_head_sha (base_dir )
You can’t perform that action at this time.
0 commit comments