lib/esruby/build.rb in esruby-0.1.2 vs lib/esruby/build.rb in esruby-0.1.3
- old
+ new
@@ -63,11 +63,11 @@
js_files += @configuration.appended_js_sources
js_files
end
def ruby_sources
- @configuration.ruby_sources + ["#{gem_directory}/resources/rb/append.rb"]
+ @configuration.ruby_sources
end
def build_mruby_config
template = File.read("#{gem_directory}/resources/build_config.eruby")
eruby = Erubis::Eruby.new(template)
@@ -123,12 +123,12 @@
mrbc = "#{build_directory}/host/bin/mrbc"
js_arguments = prepended_js_sources.map { |path| "--pre-js #{path}" }.join(" ")
js_arguments += " "
js_arguments += appended_js_sources.map { |path| "--post-js #{path}" }.join(" ")
RakeFileUtils.sh "#{mrbc} -B app -o #{build_directory}/app.c #{ruby_sources.join(" ")}"
- RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include #{build_directory}/app.c -o #{build_directory}/app.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument}"
- RakeFileUtils.sh "emcc -std=c++11 --bind -I #{mruby_directory}/include #{gem_directory}/resources/cpp/main.cpp -o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument}"
- RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include -o #{build_directory}/output.js #{build_directory}/app.o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument}"
+ RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include #{build_directory}/app.c -o #{build_directory}/app.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
+ RakeFileUtils.sh "emcc -std=c++11 --bind -I #{mruby_directory}/include #{gem_directory}/resources/cpp/main.cpp -o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
+ RakeFileUtils.sh "emcc --bind -I #{mruby_directory}/include -o #{build_directory}/output.js #{build_directory}/app.o #{build_directory}/main.o #{build_directory}/emscripten/lib/libmruby.a -lm #{js_arguments} #{optimization_argument} #{closure_argument} #{debug_argument} -s ALLOW_MEMORY_GROWTH=1"
#if build.build_mode == 'production'
# ENV["EMCC_CLOSURE_ARGS"] = "--language_in=ECMASCRIPT6" #possibly allow setting output: --language_out=ECMASCRIPT6
# sh "java -jar #{PROJECT_DIRECTORY}/emsdk/emscripten/incoming/third_party/closure-compiler/compiler.jar --js #{build.absolute_build_directory}/output.js --js_output_file #{build.absolute_output}"
#else
FileUtils.cp("#{build_directory}/output.js", "#{output}")