mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge pull request #1490 from take-cheeze/cxx_extension
support file extension .cpp/.cxx in mrbgem and tool
This commit is contained in:
@@ -41,7 +41,7 @@ depfiles = MRuby.targets['host'].bins.map do |bin|
|
||||
FileUtils.rm_f t.name, { :verbose => $verbose }
|
||||
FileUtils.cp t.prerequisites.first, t.name, { :verbose => $verbose }
|
||||
end
|
||||
|
||||
|
||||
install_path
|
||||
end
|
||||
|
||||
@@ -53,7 +53,7 @@ MRuby.each_target do |target|
|
||||
|
||||
gem.bins.each do |bin|
|
||||
exec = exefile("#{build_dir}/bin/#{bin}")
|
||||
objs = Dir.glob("#{current_dir}/tools/#{bin}/*.c").map { |f| objfile(f.pathmap("#{current_build_dir}/tools/#{bin}/%n")) }
|
||||
objs = Dir.glob("#{current_dir}/tools/#{bin}/*.{c,cpp,cxx}").map { |f| objfile(f.pathmap("#{current_build_dir}/tools/#{bin}/%n")) }
|
||||
|
||||
file exec => objs + [libfile("#{build_dir}/lib/libmruby")] do |t|
|
||||
gem_flags = gems.map { |g| g.linker.flags }
|
||||
|
||||
@@ -6,7 +6,7 @@ module MRuby
|
||||
class << self
|
||||
attr_accessor :current
|
||||
end
|
||||
LinkerConfig = Struct.new(:libraries, :library_paths, :flags, :flags_before_libraries, :flags_after_libraries)
|
||||
LinkerConfig = Struct.new(:libraries, :library_paths, :flags, :flags_before_libraries, :flags_after_libraries)
|
||||
|
||||
class Specification
|
||||
include Rake::DSL
|
||||
@@ -53,13 +53,13 @@ module MRuby
|
||||
@linker = LinkerConfig.new([], [], [], [])
|
||||
|
||||
@rbfiles = Dir.glob("#{dir}/mrblib/*.rb").sort
|
||||
@objs = Dir.glob("#{dir}/src/*.{c,cpp,m,asm,S}").map do |f|
|
||||
@objs = Dir.glob("#{dir}/src/*.{c,cpp,cxx,m,asm,S}").map do |f|
|
||||
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,m,asm,S}").map do |f|
|
||||
@test_objs = Dir.glob("#{dir}/test/*.{c,cpp,cxx,m,asm,S}").map do |f|
|
||||
objfile(f.relative_path_from(dir).to_s.pathmap("#{build_dir}/%X"))
|
||||
end
|
||||
@test_preload = 'test/assert.rb'
|
||||
@@ -211,7 +211,7 @@ module MRuby
|
||||
end
|
||||
|
||||
# ~> compare algorithm
|
||||
#
|
||||
#
|
||||
# Example:
|
||||
# ~> 2.2 means >= 2.2.0 and < 3.0.0
|
||||
# ~> 2.2.0 means >= 2.2.0 and < 2.3.0
|
||||
|
||||
Reference in New Issue
Block a user