Skip to content

Commit 4036640

Browse files
committed
macでのビルドをテスト
1 parent 3b39c1a commit 4036640

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

Rakefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ end
99
task :mruby_build do
1010
cd 'mruby' do
1111
ENV['CFLAGS'] = '/MT'
12-
sh 'rake clean'
1312
sh 'rake'
1413
end
1514
end
15+
16+
17+
task :clean do
18+
cd 'mruby' do
19+
sh 'rake clean'
20+
end
21+
end

SConstruct

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ env.Append(CPPPATH=[mruby_include_path])
2828
env.Append(LIBPATH=[mruby_library_path])
2929
env.Append(LIBS=["libmruby"])
3030

31-
# リンカフラグの追加
32-
# env.Append(LINKFLAGS=["/NODEFAULTLIB:MSVCRT"])
33-
# env.Append(LINKFLAGS=["/VERBOSE:LIB"])
34-
env.Append(LIBS=["Ws2_32"])
31+
# Windows用に追加
32+
if (os.name != 'posix'):
33+
env.Append(LIBS=["Ws2_32"])
34+
3535

3636
submodule_initialized = False
3737
dir_name = 'godot-cpp'
Binary file not shown.

src/redscribe.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,23 @@ ReDScribe::~ReDScribe() {
1818
// cleanup
1919
}
2020

21+
22+
static mrb_value
23+
mrb_foo_bar(mrb_state *mrb, mrb_value recv)
24+
{
25+
return mrb_fixnum_value(1);
26+
}
27+
2128
void ReDScribe::test_ruby() {
2229
mrb_state* mrb = mrb_open();
2330
if (!mrb) {
2431
// handle error
2532
return;
2633
}
2734

28-
mrb_load_string(mrb, "1+1");
35+
struct RClass *r = mrb_define_module(mrb, "Foo");
36+
mrb_define_module_function(mrb, r, "bar", mrb_foo_bar, MRB_ARGS_NONE());
37+
38+
mrb_load_string(mrb, "Foo.bar");
2939
mrb_close(mrb);
3040
}

0 commit comments

Comments
 (0)