Skip to content

Commit f94c055

Browse files
committed
Special case for apple, allow compiler errors through again in other cases
1 parent e82f0fd commit f94c055

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/StaticCompiler.jl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,15 @@ function generate_shlib(f, tt, path::String = tempname(), name = GPUCompiler.saf
186186

187187
write(io, obj)
188188
flush(io)
189+
190+
# Pick a Clang
191+
cc = Sys.isapple() ? `cc` : clang()
192+
# Compile!
189193
try
190-
clang() do exe
191-
run(pipeline(`$exe -shared -o $lib_path $obj_path`, stderr=devnull)) #get rid of devnull when debugging
192-
end
193-
catch e;
194-
# if Clang_jll fails, check if gcc is available
195-
run(`cc -shared -o $lib_path $obj_path`)
194+
run(`$cc -shared -o $lib_path $obj_path`)
195+
catch
196+
# If all Clangs fail, try system gcc
197+
run(`gcc -shared -o $lib_path $obj_path`)
196198
end
197199
end
198200
path, name

0 commit comments

Comments
 (0)