Rakefile in ffi-hydrogen-0.1.1 vs Rakefile in ffi-hydrogen-0.1.2

- old
+ new

@@ -1,40 +1,20 @@ require "bundler/gem_tasks" -require "ffi" require "rspec/core/rake_task" require "rubocop/rake_task" -def sys(cmd) - puts "#{cmd}" - ret = system(cmd) - raise "ERROR: '#{cmd}' failed" unless ret - ret -end +import "ext/ffi/hydrogen/Rakefile" RSpec::Core::RakeTask.new(:spec) -desc "Run RuboCop" -task :rubocop do - RuboCop::RakeTask.new -end - desc "Compile shared library" task :compile do - wflags = "-Wall -Wextra -Wmissing-prototypes -Wdiv-by-zero"\ - " -Wbad-function-cast -Wcast-align -Wcast-qual -Wfloat-equal"\ - " -Wmissing-declarations -Wnested-externs -Wno-unknown-pragmas"\ - " -Wpointer-arith -Wredundant-decls -Wstrict-prototypes -Wswitch-enum"\ - " -Wno-type-limits" + Rake::Task[:compile_shared].invoke +end - cflags = "-O3 -march=native -fPIC -fno-exceptions #{wflags}" - - # main.o: main.c - # $(CC) -c $(CFLAGS) $< -o $@ - sys("cc -c #{cflags} vendor/main.c -o vendor/main.o") - - # main.dylib: main.o - # $(CC) $< -shared -o $@ - sys("cc vendor/main.o -shared -o vendor/main.#{::FFI::Platform::LIBSUFFIX}") +desc "Run RuboCop" +task :rubocop do + RuboCop::RakeTask.new end desc "Run all benchmarks" task :bench do ruby "bench/both.rb"