File tree Expand file tree Collapse file tree 2 files changed +17
-10
lines changed
utils/swift_build_support/swift_build_support Expand file tree Collapse file tree 2 files changed +17
-10
lines changed Original file line number Diff line number Diff line change 21
21
22
22
from . import product
23
23
from .. import shell
24
+ from ..utils import log_time_in_scope
24
25
25
26
26
27
class Ninja (product .Product ):
@@ -53,15 +54,18 @@ def ninja_bin_path(self):
53
54
def build (self ):
54
55
if os .path .exists (self .ninja_bin_path ):
55
56
return
56
- shell .call ([
57
- self .toolchain .cmake ,
58
- "-S" , self .source_dir ,
59
- "-B" , self .build_dir ,
60
- "-DCMAKE_BUILD_TYPE=Release" ,
61
- "-DBUILD_TESTING=OFF" ,
62
- f"-DCMAKE_C_COMPILER={ self .toolchain .cc } " ,
63
- f"-DCMAKE_CXX_COMPILER={ self .toolchain .cxx } " ])
64
- shell .call ([self .toolchain .cmake , "--build" , self .build_dir ])
57
+
58
+ print ("--- Local Ninja Build ---" )
59
+ with log_time_in_scope ('local ninja' ):
60
+ shell .call ([
61
+ self .toolchain .cmake ,
62
+ "-S" , self .source_dir ,
63
+ "-B" , self .build_dir ,
64
+ "-DCMAKE_BUILD_TYPE=Release" ,
65
+ "-DBUILD_TESTING=OFF" ,
66
+ f"-DCMAKE_C_COMPILER={ self .toolchain .cc } " ,
67
+ f"-DCMAKE_CXX_COMPILER={ self .toolchain .cxx } " ])
68
+ shell .call ([self .toolchain .cmake , "--build" , self .build_dir ])
65
69
66
70
67
71
def get_ninja_version (ninja_bin_path ):
Original file line number Diff line number Diff line change @@ -48,8 +48,11 @@ def clear_log_time():
48
48
49
49
50
50
def log_time (event , command , duration = 0 ):
51
- f = open (log_time_path (), "a" )
51
+ log_time_dir = os .path .dirname (log_time_path ())
52
+ if not os .path .isdir (log_time_dir ):
53
+ os .mkdir (log_time_dir )
52
54
55
+ f = open (log_time_path (), "a" )
53
56
log_event = {
54
57
"event" : event ,
55
58
"command" : command ,
You can’t perform that action at this time.
0 commit comments