@@ -121,27 +121,37 @@ def add_optional_flags(self):
121
121
ext .extra_compile_args .append ('-fvisibility-inlines-hidden' )
122
122
cxxflags .append ('-fvisibility-inlines-hidden' )
123
123
ranlib = 'RANLIB' in env
124
+ print_raw (f'RANLIB is { "" if ranlib else "not " } in the environment' )
124
125
if not ranlib and self .compiler .compiler_type == 'unix' :
126
+ print_raw ('RANLIB unset and compiler is unix' )
125
127
try :
126
128
version = subprocess .run (self .compiler .compiler +
127
129
['--version' ],
128
130
stdout = subprocess .PIPE ,
129
131
stderr = subprocess .STDOUT ,
130
132
universal_newlines = True ).stdout
131
133
except Exception as e :
132
- print ( 'Compiler version check failed: ' , e )
134
+ print_raw ( f 'Compiler version check failed: { e } ' )
133
135
else :
136
+ print_raw (f'Compiler output is { version !r} ' )
134
137
if 'GCC' in version :
138
+ print_raw ('Compiler is GCC' )
135
139
if 'TRAVIS' in os .environ :
140
+ print_raw ('Travis is set; enabling ranlib' )
136
141
ranlib = True
137
142
else :
138
143
ranlib = shutil .which ('gcc-ranlib' )
144
+ print_raw (f'Searched for gcc-ranlib: { ranlib } ' )
139
145
elif 'clang' in version :
146
+ print_raw ('Compiler is clang' )
140
147
if sys .platform == 'darwin' :
148
+ print_raw ('Platform is darwin; enabling ranlib' )
141
149
ranlib = True
142
150
else :
143
151
ranlib = shutil .which ('llvm-ranlib' )
152
+ print_raw (f'Searched for llvm-ranlib: { ranlib } ' )
144
153
if ranlib and has_flag (self .compiler , '-flto' ):
154
+ print_raw ('Both ranlib and lto are available' )
145
155
for ext in self .extensions :
146
156
ext .extra_compile_args .append ('-flto' )
147
157
cppflags .append ('-flto' )
0 commit comments