Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions build_config.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
MRuby::Build.new do |conf|
# load specific toolchain settings

# Gets set by the VS command prompts.
def detect_toolchain
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
:visualcpp
else
toolchain :gcc
cc = ENV['CC'] || 'cc'
if `#{cc} --version 2>&1` =~ /clang/i
:clang
else
:gcc
end
end
end

MRuby::Build.new do |conf|
toolchain detect_toolchain

enable_debug

Expand Down Expand Up @@ -85,14 +91,7 @@
end

MRuby::Build.new('host-debug') do |conf|
# load specific toolchain settings

# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
toolchain detect_toolchain

enable_debug

Expand All @@ -110,12 +109,7 @@
end

MRuby::Build.new('test') do |conf|
# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
toolchain detect_toolchain

enable_debug
conf.enable_bintest
Expand Down
2 changes: 1 addition & 1 deletion tasks/toolchains/gcc.rake
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ MRuby::Toolchain.new(:gcc) do |conf, _params|
conf.linker do |linker|
linker.command = ENV['LD'] || 'gcc'
linker.flags = [ENV['LDFLAGS'] || %w()]
linker.libraries = %w(m)
linker.libraries = RUBY_PLATFORM =~ /darwin/ ? %w() : %w(m)
linker.library_paths = []
linker.option_library = '-l%s'
linker.option_library_path = '-L%s'
Expand Down