From f46e1ee51832e9e542412f112ccf89cfa2f7ef34 Mon Sep 17 00:00:00 2001 From: jj Date: Wed, 21 Mar 2012 19:30:31 +0100 Subject: [PATCH] ruby: link libruby, fix stuff, it works --- plugins/ruby/CMakeLists.txt | 2 + plugins/ruby/ruby.cpp | 5 ++- plugins/ruby/ruby.rb | 78 ++++++++++++++++++------------------- 3 files changed, 45 insertions(+), 40 deletions(-) diff --git a/plugins/ruby/CMakeLists.txt b/plugins/ruby/CMakeLists.txt index dc5f0284a..a44fb52cd 100644 --- a/plugins/ruby/CMakeLists.txt +++ b/plugins/ruby/CMakeLists.txt @@ -2,6 +2,8 @@ find_package(Ruby) if(RUBY_FOUND) include_directories("${dfhack_SOURCE_DIR}/depends/tthread" ${RUBY_INCLUDE_PATH}) DFHACK_PLUGIN(ruby ruby.cpp LINK_LIBRARIES dfhack-tinythread) + target_link_libraries(ruby ${RUBY_LIBRARY}) + install(FILES ruby.rb DESTINATION ${DFHACK_LIBRARY_DESTINATION}) else(RUBY_FOUND) MESSAGE(STATUS "Required library (ruby) not found - ruby plugin can't be built.") endif(RUBY_FOUND) diff --git a/plugins/ruby/ruby.cpp b/plugins/ruby/ruby.cpp index 7ecda28ca..592525332 100644 --- a/plugins/ruby/ruby.cpp +++ b/plugins/ruby/ruby.cpp @@ -44,6 +44,7 @@ DFHACK_PLUGIN("ruby") DFhackCExport command_result plugin_init ( color_ostream &out, std::vector &commands) { +out.print("plugin_init\n"); m_irun = new tthread::mutex(); m_mutex = new tthread::mutex(); r_type = RB_INIT; @@ -72,6 +73,7 @@ DFhackCExport command_result plugin_init ( color_ostream &out, std::vector