@@ -34,10 +34,9 @@ def build(self, host_target):
34
34
llvm_build_dir = join_path (self .build_dir , '../llvm-' + host_target )
35
35
libdispatch_path = join_path (self .args .install_destdir , 'usr' )
36
36
37
- cmd = [
37
+ config_cmd = [
38
38
'cmake' ,
39
39
'-GNinja' ,
40
- '-B%s' % self .build_dir ,
41
40
'-DCMAKE_PREFIX_PATH=%s' % llvm_build_dir ,
42
41
'-DCMAKE_C_COMPILER=clang' ,
43
42
'-DCMAKE_CXX_COMPILER=clang++' ,
@@ -47,13 +46,20 @@ def build(self, host_target):
47
46
'-DCOMPILER_RT_INTERCEPT_LIBDISPATCH=ON' ,
48
47
'-DCOMPILER_RT_LIBDISPATCH_INSTALL_PATH=%s' % libdispatch_path ,
49
48
rt_source_dir ]
50
- shell . call ( cmd )
49
+ build_cmd = [ 'ninja' , 'tsan' ]
51
50
52
- cmd = ['cmake' , '--build' , self .build_dir , '--target' , 'tsan' ]
53
- shell .call (cmd )
51
+ # Always rebuild TSan runtime
52
+ shell .rmtree (self .build_dir )
53
+ shell .makedirs (self .build_dir )
54
+
55
+ with shell .pushd (self .build_dir ):
56
+ shell .call (config_cmd )
57
+ shell .call (build_cmd )
54
58
55
59
def test (self , host_target ):
56
60
"""Run check-tsan target with a LIT filter for libdispatch."""
57
- cmd = ['cmake' , '--build' , self . build_dir , '--target ' , 'check-tsan' ]
61
+ cmd = ['ninja ' , 'check-tsan' ]
58
62
env = {'LIT_FILTER' : 'libdispatch' }
59
- shell .call (cmd , env = env )
63
+
64
+ with shell .pushd (self .build_dir ):
65
+ shell .call (cmd , env = env )
0 commit comments