Commit b26ca1b5 authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #2025 from take-cheeze/cxx_abi_fix

Fix C++ files detection for automatic C++ ABI enabling.
parents c5c87424 66e0df34
......@@ -40,7 +40,6 @@ module MRuby
@name = name
@initializer = block
@version = "0.0.0"
@cxx_abi_enabled = false
MRuby::Gem.current = self
end
......@@ -48,10 +47,6 @@ module MRuby
not test_preload.nil? or not test_objs.empty?
end
def cxx_abi_enabled?
@cxx_abi_enabled
end
def setup
MRuby::Gem.current = self
@build.compilers.each do |compiler|
......@@ -64,14 +59,12 @@ module MRuby
@rbfiles = Dir.glob("#{dir}/mrblib/*.rb").sort
@objs = Dir.glob("#{dir}/src/*.{c,cpp,cxx,m,asm,S}").map do |f|
@cxx_abi_enabled = true if f =~ /(cxx|cpp)$/
objfile(f.relative_path_from(@dir).to_s.pathmap("#{build_dir}/%X"))
end
@objs << objfile("#{build_dir}/gem_init")
@test_rbfiles = Dir.glob("#{dir}/test/*.rb")
@test_objs = Dir.glob("#{dir}/test/*.{c,cpp,cxx,m,asm,S}").map do |f|
@cxx_abi_enabled = true if f =~ /(cxx|cpp)$/
objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X"))
end
@test_preload = nil # 'test/assert.rb'
......
......@@ -30,12 +30,15 @@ module MRuby
load gemrake
return nil unless Gem.current
enable_cxx_abi if Gem.current.cxx_abi_enabled?
Gem.current.dir = gemdir
Gem.current.build = MRuby::Build.current
Gem.current.build_config_initializer = block
gems << Gem.current
cxx_srcs = Dir.glob("#{Gem.current.dir}/src/*.{cpp,cxx}")
cxx_srcs += Dir.glob("#{Gem.current.dir}/test/*.{cpp,cxx}")
enable_cxx_abi unless cxx_srcs.empty?
Gem.current
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment