diff options
| -rw-r--r-- | appveyor.yml | 27 | ||||
| -rw-r--r-- | appveyor_config.rb | 50 | ||||
| -rw-r--r-- | examples/targets/build_config_IntelEdison.rb | 69 | ||||
| -rw-r--r-- | tasks/mrbgem_spec.rake | 3 |
4 files changed, 149 insertions, 0 deletions
diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..e8aaa033c --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,27 @@ +version: "{build}" + +os: Visual Studio 2015 + +clone_depth: 1 + + +environment: + matrix: + # Visual Studio 2015 64bit + - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat + machine: amd64 + + # Visual Studio 2013 64bit + - visualcpp: C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat + machine: amd64 + + +init: + - call "%visualcpp%" %machine% + # For using bison.exe + - set PATH=%PATH%;C:\cygwin\bin; + + +build_script: + - set MRUBY_CONFIG=appveyor_config.rb + - ruby .\minirake test diff --git a/appveyor_config.rb b/appveyor_config.rb new file mode 100644 index 000000000..57e103307 --- /dev/null +++ b/appveyor_config.rb @@ -0,0 +1,50 @@ +MRuby::Build.new('debug') do |conf| + toolchain :visualcpp + enable_debug + + # include all core GEMs + conf.gembox 'full-core' + conf.compilers.each do |c| + c.defines += %w(MRB_GC_STRESS MRB_GC_FIXED_ARENA) + end + + build_mrbc_exec +end + +MRuby::Build.new('full-debug') do |conf| + toolchain :visualcpp + enable_debug + + # include all core GEMs + conf.gembox 'full-core' + conf.cc.defines = %w(MRB_ENABLE_DEBUG_HOOK) + + conf.enable_test +end + +MRuby::Build.new do |conf| + toolchain :visualcpp + + # include all core GEMs + conf.gembox 'full-core' + conf.compilers.each do |c| + c.defines += %w(MRB_GC_FIXED_ARENA) + end + conf.enable_bintest + conf.enable_test +end + +MRuby::Build.new('cxx_abi') do |conf| + toolchain :visualcpp + + conf.gembox 'full-core' + conf.compilers.each do |c| + c.defines += %w(MRB_GC_FIXED_ARENA) + end + conf.enable_bintest + conf.enable_test + + enable_cxx_abi + + build_mrbc_exec +end diff --git a/examples/targets/build_config_IntelEdison.rb b/examples/targets/build_config_IntelEdison.rb new file mode 100644 index 000000000..7383f3b4e --- /dev/null +++ b/examples/targets/build_config_IntelEdison.rb @@ -0,0 +1,69 @@ +# Cross-compiling setup for Intel Edison (poky linux) platform +# Get SDK from here: https://software.intel.com/en-us/iot/hardware/edison/downloads +# REMEMBER to check and update the SDK root in the constant POKY_EDISON_PATH + +MRuby::Build.new do |conf| + toolchain :gcc + conf.gembox 'default' + conf.cc.defines = %w(ENABLE_READLINE) + conf.gembox 'default' + + #lightweight regular expression + conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master" + +end + +# Define cross build settings +MRuby::CrossBuild.new('core2-32-poky-linux') do |conf| + toolchain :gcc + + # Mac OS X + # + POKY_EDISON_PATH = '/opt/poky-edison/1.7.2' + + POKY_EDISON_SYSROOT = "#{POKY_EDISON_PATH}/sysroots/core2-32-poky-linux" + POKY_EDISON_X86_PATH = "#{POKY_EDISON_PATH}/sysroots/i386-pokysdk-darwin" + POKY_EDISON_BIN_PATH = "#{POKY_EDISON_X86_PATH}/usr/bin/i586-poky-linux" + + + conf.cc do |cc| + cc.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-gcc" + cc.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include", "#{POKY_EDISON_X86_PATH}/usr/include"] + cc.flags = %w(-m32 -march=core2 -mtune=core2 -msse3 -mfpmath=sse -mstackrealign -fno-omit-frame-pointer) + cc.flags << %w(-O2 -pipe -g -feliminate-unused-debug-types) + cc.flags << "--sysroot=#{POKY_EDISON_SYSROOT}" + cc.compile_options = "%{flags} -o %{outfile} -c %{infile}" + cc.defines = %w(ENABLE_READLINE) + end + + conf.cxx do |cxx| + cxx.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-g++" + cxx.include_paths = conf.cc.include_paths.dup + cxx.include_paths << ["#{POKY_EDISON_SYSROOT}/usr/include/c++/4.9.1"] + cxx.flags = conf.cc.flags.dup + cxx.defines = conf.cc.defines.dup + cxx.compile_options = conf.cc.compile_options.dup + end + + conf.archiver do |archiver| + archiver.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-ar" + archiver.archive_options = 'rcs %{outfile} %{objs}' + end + + conf.linker do |linker| + linker.command = "#{POKY_EDISON_BIN_PATH}/i586-poky-linux-g++" + linker.flags = %w(-m32 -march=i586) + linker.flags << "--sysroot=#{POKY_EDISON_SYSROOT}" + linker.flags << %w(-O1) + linker.libraries = %w(m pthread) + end + + #do not build executable test + conf.build_mrbtest_lib_only + + conf.gembox 'default' + + #lightweight regular expression + conf.gem :github => "pbosetti/mruby-hs-regexp", :branch => "master" + +end diff --git a/tasks/mrbgem_spec.rake b/tasks/mrbgem_spec.rake index e91823029..548f1e041 100644 --- a/tasks/mrbgem_spec.rake +++ b/tasks/mrbgem_spec.rake @@ -413,9 +413,12 @@ module MRuby # as circular dependency has already detected in the caller. import_include_paths(dep_g) + dep_g.export_include_paths.uniq! g.compilers.each do |compiler| compiler.include_paths += dep_g.export_include_paths g.export_include_paths += dep_g.export_include_paths + compiler.include_paths.uniq! + g.export_include_paths.uniq! end end end |
