mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Fix C++ files detection for automatic C++ ABI enabling.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user