fix for mswin32

This commit is contained in:
ser1zw 2014-02-11 01:15:11 +09:00
parent 4433b47190
commit 30709a1db0
1 changed files with 4 additions and 9 deletions

View File

@ -4,6 +4,9 @@ CC = RbConfig::CONFIG['CC']
if CC =~ /clang/
RbConfig::MAKEFILE_CONFIG['try_header'] = :try_cpp
RbConfig::CONFIG['CPP'] = "#{CC} -E"
elsif RbConfig::CONFIG['arch'] =~ /mswin32/
RbConfig::MAKEFILE_CONFIG['try_header'] = :try_cpp
RbConfig::CONFIG['CPP'] = "#{CC} /P"
end
require "mkmf"
@ -65,15 +68,7 @@ end
# Check the required headers
puts ">> Check the required headers..."
opencv_headers.each {|header|
unless have_header(header)
if CONFIG["arch"] =~ /mswin32/ and File.exists? "#{incdir}/#{header}"
# In mswin32, have_header('opencv2/nonfree/nonfree.hpp') fails because of a syntax problem.
warn "warning: #{header} found but `have_header` failed."
$defs << "-DHAVE_#{header.tr_cpp}"
else
raise "#{header} not found."
end
end
raise "#{header} not found." unless have_header(header)
}
have_header("stdarg.h")