mirror of
https://github.com/ruby-opencv/ruby-opencv
synced 2023-03-27 23:22:12 -04:00
workaround for mswin32
This commit is contained in:
parent
1a81a17d82
commit
1a44eeeab4
1 changed files with 10 additions and 2 deletions
12
extconf.rb
12
extconf.rb
|
@ -11,7 +11,7 @@ VC : ruby extconf.rb
|
||||||
=end
|
=end
|
||||||
require "mkmf"
|
require "mkmf"
|
||||||
|
|
||||||
dir_config("opencv", "/usr/local/include", "/usr/local/lib")
|
incdir, libdir = dir_config("opencv", "/usr/local/include", "/usr/local/lib")
|
||||||
dir_config("libxml2", "/usr/include", "/usr/lib")
|
dir_config("libxml2", "/usr/include", "/usr/lib")
|
||||||
|
|
||||||
opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/imgproc/imgproc_c.h",
|
opencv_headers = ["opencv2/core/core_c.h", "opencv2/core/core.hpp", "opencv2/imgproc/imgproc_c.h",
|
||||||
|
@ -53,7 +53,15 @@ end
|
||||||
# Check the required headers
|
# Check the required headers
|
||||||
puts ">> Check the required headers..."
|
puts ">> Check the required headers..."
|
||||||
opencv_headers.each {|header|
|
opencv_headers.each {|header|
|
||||||
raise "#{header} not found." unless have_header(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
|
||||||
}
|
}
|
||||||
have_header("stdarg.h")
|
have_header("stdarg.h")
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue