@@ -4,7 +4,7 @@ module MRuby
44 class Command
55 include Rake ::DSL
66 extend Forwardable
7- def_delegators :@build , :filename , :objfile , :libfile , :exefile , :cygwin_filename
7+ def_delegators :@build , :filename , :objfile , :libfile , :exefile
88 attr_accessor :build , :command
99
1010 def initialize ( build )
@@ -79,25 +79,16 @@ def search_header(name)
7979 def all_flags ( _defines = [ ] , _include_paths = [ ] , _flags = [ ] )
8080 define_flags = [ defines , _defines ] . flatten . map { |d | option_define % d }
8181 include_path_flags = [ include_paths , _include_paths ] . flatten . map do |f |
82- if MRUBY_BUILD_HOST_IS_CYGWIN
83- option_include_path % cygwin_filename ( f )
84- else
85- option_include_path % filename ( f )
86- end
82+ option_include_path % filename ( f )
8783 end
8884 [ flags , define_flags , include_path_flags , _flags ] . flatten . join ( ' ' )
8985 end
9086
9187 def run ( outfile , infile , _defines = [ ] , _include_paths = [ ] , _flags = [ ] )
9288 mkdir_p File . dirname ( outfile )
9389 _pp "CC" , infile . relative_path , outfile . relative_path
94- if MRUBY_BUILD_HOST_IS_CYGWIN
95- _run compile_options , { :flags => all_flags ( _defines , _include_paths , _flags ) ,
96- :infile => cygwin_filename ( infile ) , :outfile => cygwin_filename ( outfile ) }
97- else
98- _run compile_options , { :flags => all_flags ( _defines , _include_paths , _flags ) ,
99- :infile => filename ( infile ) , :outfile => filename ( outfile ) }
100- end
90+ _run compile_options , { :flags => all_flags ( _defines , _include_paths , _flags ) ,
91+ :infile => filename ( infile ) , :outfile => filename ( outfile ) }
10192 end
10293
10394 def define_rules ( build_dir , source_dir = '' )
@@ -191,11 +182,7 @@ def initialize(build)
191182
192183 def all_flags ( _library_paths = [ ] , _flags = [ ] )
193184 library_path_flags = [ library_paths , _library_paths ] . flatten . map do |f |
194- if MRUBY_BUILD_HOST_IS_CYGWIN
195- option_library_path % cygwin_filename ( f )
196- else
197- option_library_path % filename ( f )
198- end
185+ option_library_path % filename ( f )
199186 end
200187 [ flags , library_path_flags , _flags ] . flatten . join ( ' ' )
201188 end
@@ -209,19 +196,11 @@ def run(outfile, objfiles, _libraries=[], _library_paths=[], _flags=[], _flags_b
209196 library_flags = [ libraries , _libraries ] . flatten . map { |d | option_library % d }
210197
211198 _pp "LD" , outfile . relative_path
212- if MRUBY_BUILD_HOST_IS_CYGWIN
213- _run link_options , { :flags => all_flags ( _library_paths , _flags ) ,
214- :outfile => cygwin_filename ( outfile ) , :objs => cygwin_filename ( objfiles ) . join ( ' ' ) ,
215- :flags_before_libraries => [ flags_before_libraries , _flags_before_libraries ] . flatten . join ( ' ' ) ,
216- :flags_after_libraries => [ flags_after_libraries , _flags_after_libraries ] . flatten . join ( ' ' ) ,
217- :libs => library_flags . join ( ' ' ) }
218- else
219- _run link_options , { :flags => all_flags ( _library_paths , _flags ) ,
220- :outfile => filename ( outfile ) , :objs => filename ( objfiles ) . map { |f | %Q["#{ f } "] } . join ( ' ' ) ,
221- :flags_before_libraries => [ flags_before_libraries , _flags_before_libraries ] . flatten . join ( ' ' ) ,
222- :flags_after_libraries => [ flags_after_libraries , _flags_after_libraries ] . flatten . join ( ' ' ) ,
223- :libs => library_flags . join ( ' ' ) }
224- end
199+ _run link_options , { :flags => all_flags ( _library_paths , _flags ) ,
200+ :outfile => filename ( outfile ) , :objs => filename ( objfiles ) . map { |f | %Q["#{ f } "] } . join ( ' ' ) ,
201+ :flags_before_libraries => [ flags_before_libraries , _flags_before_libraries ] . flatten . join ( ' ' ) ,
202+ :flags_after_libraries => [ flags_after_libraries , _flags_after_libraries ] . flatten . join ( ' ' ) ,
203+ :libs => library_flags . join ( ' ' ) }
225204 end
226205 end
227206
@@ -237,11 +216,7 @@ def initialize(build)
237216 def run ( outfile , objfiles )
238217 mkdir_p File . dirname ( outfile )
239218 _pp "AR" , outfile . relative_path
240- if MRUBY_BUILD_HOST_IS_CYGWIN
241- _run archive_options , { :outfile => cygwin_filename ( outfile ) , :objs => cygwin_filename ( objfiles ) . map { |f | %Q["#{ f } "] } . join ( ' ' ) }
242- else
243- _run archive_options , { :outfile => filename ( outfile ) , :objs => filename ( objfiles ) . map { |f | %Q["#{ f } "] } . join ( ' ' ) }
244- end
219+ _run archive_options , { :outfile => filename ( outfile ) , :objs => filename ( objfiles ) . map { |f | %Q["#{ f } "] } . join ( ' ' ) }
245220 end
246221 end
247222
0 commit comments