diff options
| author | crimsonwoods <[email protected]> | 2013-11-23 19:30:52 -0800 |
|---|---|---|
| committer | crimsonwoods <[email protected]> | 2013-11-23 19:30:52 -0800 |
| commit | caf4d6322925d4b0aa2ad4810df812603cec508b (patch) | |
| tree | 359a2e00dc662c32199b8e37485e1d49574b6ac1 | |
| parent | a2e0c6ea3a104510ad3a5ecc0ee0f96297f6a550 (diff) | |
| download | mruby-caf4d6322925d4b0aa2ad4810df812603cec508b.tar.gz mruby-caf4d6322925d4b0aa2ad4810df812603cec508b.zip | |
Modify build script for gcc.
Newly added compile option '-std=gnu99' is not necessary for C++.
And 'g++' should be used to compile for C++ source codes, I think.
| -rw-r--r-- | tasks/toolchains/gcc.rake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tasks/toolchains/gcc.rake b/tasks/toolchains/gcc.rake index 9b0b39d5c..27917d1c5 100644 --- a/tasks/toolchains/gcc.rake +++ b/tasks/toolchains/gcc.rake @@ -1,5 +1,5 @@ MRuby::Toolchain.new(:gcc) do |conf| - [conf.cc, conf.cxx, conf.objc, conf.asm].each do |cc| + [conf.cc, conf.objc, conf.asm].each do |cc| cc.command = ENV['CC'] || 'gcc' cc.flags = [ENV['CFLAGS'] || %w(-g -std=gnu99 -O3 -Wall -Werror-implicit-function-declaration)] cc.include_paths = ["#{MRUBY_ROOT}/include"] @@ -9,6 +9,16 @@ MRuby::Toolchain.new(:gcc) do |conf| cc.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' end + [conf.cxx].each do |cxx| + cxx.command = ENV['CC'] || 'g++' + cxx.flags = [ENV['CFLAGS'] || %w(-g -O3 -Wall -Werror-implicit-function-declaration)] + cxx.include_paths = ["#{MRUBY_ROOT}/include"] + cxx.defines = %w(DISABLE_GEMS) + cxx.option_include_path = '-I%s' + cxx.option_define = '-D%s' + cxx.compile_options = '%{flags} -MMD -o %{outfile} -c %{infile}' + end + conf.linker do |linker| linker.command = ENV['LD'] || 'gcc' linker.flags = [ENV['LDFLAGS'] || %w()] |
