Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Patch from Gaspard Bucher to fix C++ compile issues

git-svn-id: http://mkrf.rubyforge.org/svn/trunk@59 6e48df83-f314-0410-b1e7-e69642b30866
  • Loading branch information...
commit e6cb2bcc9b4f330af9be1f51e1a68e3c2f832a00 1 parent a08f626
hoanga authored
Showing with 8 additions and 2 deletions.
  1. +8 −2 lib/mkrf/generator.rb
View
10 lib/mkrf/generator.rb
@@ -75,7 +75,13 @@ def initialize(extension_name, source_patterns = ["*.c"], availability_options =
@extension_name = extension_name + ".#{CONFIG['DLEXT']}"
@available = Mkrf::Availability.new(availability_options)
@defines = []
- @cc = CONFIG['CC']
+ if @sources[0] =~ /cpp/
+ @cc = 'g++' # should be in CONFIG['C++'] but is not.
+ @source_extension = 'cpp'
+ else
+ @cc = CONFIG['CC']
+ @source_extension = 'c'
+ end
@objects = ''
@ldshared = ''
@@ -193,7 +199,7 @@ def rakefile_contents # :nodoc:
task :default => ['#{@extension_name}']
-rule '.#{objext}' => '.c' do |t|
+rule '.#{objext}' => '.#{@source_extension}' do |t|
sh "\#{CC} \#{CFLAGS} \#{INCLUDES} -c \#{t.source}"
end
Please sign in to comment.
Something went wrong with that request. Please try again.