Skip to content

Commit

Permalink
Deeper DEV flags, added -Wextra to both. Extensions use the build flags.
Browse files Browse the repository at this point in the history
  • Loading branch information
Eero Saynatkari committed Oct 18, 2008
1 parent ff913eb commit 3345de6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
5 changes: 5 additions & 0 deletions lib/bin/compile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ def compile_files
puts cmd if $VERBOSE
system cmd

unless $?.success?
puts "\n\n ** Compiling failed. Aborting.\n\n"
exit 1
end

@objects << out
end
end
Expand Down
11 changes: 5 additions & 6 deletions rakelib/extensions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ task :extensions => %w[
#
# Ask the VM to build an extension from source.
#
def compile_extension(path, flags = nil, extra_flags = nil)
flags ||= "-d -p -C,-ggdb3 -C,-O0 -I#{Dir.pwd}/vm/subtend"
command = "./bin/rbx compile #{flags} #{extra_flags} #{path}"
def compile_extension(path, flags = "-d -p -I#{Dir.pwd}/vm/subtend")
cflags = Object.const_get(:FLAGS).reject {|f| f == "-Wno-deprecated" }

puts "Executing `#{command}`" if $verbose
cflags.each {|flag| flags << " -C,#{flag}" }

command = "./bin/rbx compile #{flags} #{path}"

sh command
end
Expand All @@ -34,8 +35,6 @@ namespace :extension do
Dir["lib/ext/**/*.{o,#{$dlext}}"].each do |f|
rm_f f, :verbose => $verbose
end

# FileList["lib/ext/**/*.o"].each {|f| rm f, :verbose => $verbose }
end

desc "Build the readline extension"
Expand Down
18 changes: 9 additions & 9 deletions rakelib/vm.rake
Original file line number Diff line number Diff line change
Expand Up @@ -109,17 +109,17 @@ if LLVM_STYLE == "Release"
OPTIONS[LLVM_A] << " --enable-optimized"
end

INCLUDES = EX_INC + %w[/usr/local/include vm/test/cxxtest vm .]
INCLUDES = EX_INC + %w[/usr/local/include vm/test/cxxtest vm .]
INCLUDES.map! { |f| "-I#{f}" }
FLAGS = %w[
-pipe
-Wall -Werror -Wno-deprecated
-ggdb -gdwarf-2
-fno-strict-aliasing
]

unless ENV["DEV"]
FLAGS << "-O2"
# Build options
FLAGS = %w[ -pipe -Wall -Wextra -Wno-deprecated ]

# Debugging support &c.
if ENV["DEV"]
FLAGS.concat %w[ -Werror -ggdb3 -O0 -fno-inline]
else
FLAGS.concat %w[ -O2 ]
end

CC = ENV['CC'] || "gcc"
Expand Down

0 comments on commit 3345de6

Please sign in to comment.