@@ -48,21 +48,27 @@ class Configuration:
48
48
def __init__ (self ):
49
49
pass
50
50
51
+ def _encode_path (self , path ):
52
+ if path is not None :
53
+ return path .absolute ()
54
+ else :
55
+ return None
56
+
51
57
def write (self , path ):
52
58
info = {
53
59
'version' : self .version ,
54
60
'command' : self .command ,
55
61
'project' : self .project ,
56
- 'script_path' : self .script_path . absolute ( ),
57
- 'build_script_path' : self .build_script_path . absolute ( ),
58
- 'source_root' : self .source_root . absolute ( ),
62
+ 'script_path' : self ._encode_path ( self . script_path ),
63
+ 'build_script_path' : self ._encode_path ( self . build_script_path ),
64
+ 'source_root' : self ._encode_path ( self . source_root ),
59
65
'target' : self .target .triple ,
60
- 'system_root' : self .system_root . absolute ( ),
66
+ 'system_root' : self ._encode_path ( self . system_root ),
61
67
'toolchain' : self .toolchain ,
62
- 'build_directory' : self .build_directory . absolute ( ),
63
- 'intermediate_directory' : self .intermediate_directory . absolute ( ),
64
- 'module_cache_directory' : self .module_cache_directory . absolute ( ),
65
- 'install_directory' : self .install_directory . absolute ( ),
68
+ 'build_directory' : self ._encode_path ( self . build_directory ),
69
+ 'intermediate_directory' : self ._encode_path ( self . intermediate_directory ),
70
+ 'module_cache_directory' : self ._encode_path ( self . module_cache_directory ),
71
+ 'install_directory' : self ._encode_path ( self . install_directory ),
66
72
'prefix' : self .prefix ,
67
73
'swift_install' : self .swift_install ,
68
74
'clang' : self .clang ,
@@ -71,7 +77,7 @@ def write(self, path):
71
77
'swiftc' : self .swiftc ,
72
78
'ar' : self .ar ,
73
79
'swift_sdk' : self .swift_sdk ,
74
- 'bootstrap_directory' : self .bootstrap_directory . absolute ( ),
80
+ 'bootstrap_directory' : self ._encode_path ( self . bootstrap_directory ),
75
81
'verbose' : self .verbose ,
76
82
'extra_c_flags' : self .extra_c_flags ,
77
83
'extra_swift_flags' : self .extra_swift_flags ,
0 commit comments