Imported Upstream version 1.46.0
[platform/upstream/nghttp2.git] / third-party / mruby / tasks / toolchains / clang.rake
index 2832dad..543cb73 100644 (file)
@@ -1,9 +1,8 @@
 MRuby::Toolchain.new(:clang) do |conf, _params|
-  toolchain :gcc
+  toolchain :gcc, default_command: 'clang'
 
   [conf.cc, conf.objc, conf.asm].each do |cc|
-    cc.command = ENV['CC'] || 'clang'
+    cc.flags << '-Wzero-length-array' unless ENV['CFLAGS']
   end
-  conf.cxx.command = ENV['CXX'] || 'clang++'
-  conf.linker.command = ENV['LD'] || ENV['CXX'] || ENV['CC'] || 'clang'
+  conf.cxx.flags << '-Wzero-length-array' unless ENV['CXXFLAGS'] || ENV['CFLAGS']
 end