Skip to content

Commit

Permalink
Fix mruby build
Browse files Browse the repository at this point in the history
Copy build_config.rb to build directory because now
build_config.rb.lock is created along side it.

Define toolchain depending on CC environment variable.
  • Loading branch information
tatsuhiro-t committed Sep 2, 2020
1 parent 7df73a5 commit 181a007
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions third-party/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ EXTRA_DIST += build_config.rb mruby/*
.PHONY: all-local clean mruby

mruby:
MRUBY_CONFIG="${srcdir}/build_config.rb" \
mkdir -p "${abs_builddir}/mruby/build"
diff "${srcdir}/build_config.rb" "${abs_builddir}/mruby/build/build_config.rb" >& /dev/null || \
cp "${srcdir}/build_config.rb" "${abs_builddir}/mruby/build"
MRUBY_CONFIG="${abs_builddir}/mruby/build/build_config.rb" \
BUILD_DIR="${abs_builddir}/mruby/build" \
INSTALL_DIR="${abs_builddir}/mruby/build/install/bin" \
CC="${CC}" CXX="$(firstword $(CXX))" LD="${LD}" \
Expand All @@ -66,7 +69,7 @@ mruby:
all-local: mruby

clean-local:
MRUBY_CONFIG="${srcdir}/build_config.rb" \
MRUBY_CONFIG="${abs_builddir}/mruby/build/build_config.rb" \
BUILD_DIR="${abs_builddir}/mruby/build" \
"${srcdir}/mruby/minirake" -f "${srcdir}/mruby/Rakefile" clean

Expand Down
4 changes: 2 additions & 2 deletions third-party/build_config.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MRuby::Build.new do |conf|
# TODO use same compilers configured in configure script
toolchain :clang
toolchain :clang if ENV['CC'].include? "clang"
toolchain :gcc if ENV['CC'].include? "gcc"

# C++ project needs this. Without this, mruby exception does not
# properly destory C++ object allocated on stack.
Expand Down

0 comments on commit 181a007

Please sign in to comment.