Skip to content

Commit

Permalink
Merge pull request #6 from kkaempf/master
Browse files Browse the repository at this point in the history
Ruby: fix initialization
  • Loading branch information
tgoettlicher committed Jun 12, 2012
2 parents d2abdf8 + cdf6cca commit 76cc85a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
2 changes: 1 addition & 1 deletion swig/ruby/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ADD_CUSTOM_COMMAND (
ADD_LIBRARY( yui_ruby SHARED ${SWIG_OUTPUT} )
INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} ${LIBYUI_INCLUDE_DIR} )

SET_TARGET_PROPERTIES( yui_ruby PROPERTIES PREFIX "" OUTPUT_NAME "yui")
SET_TARGET_PROPERTIES( yui_ruby PROPERTIES PREFIX "" OUTPUT_NAME "_yui")

TARGET_LINK_LIBRARIES( yui_ruby ${LIBYUI_LIBRARY} )
TARGET_LINK_LIBRARIES( yui_ruby ${RUBY_LIBRARY} )
Expand Down
10 changes: 5 additions & 5 deletions swig/ruby/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
#
# extconf.rb for yui Gem
#
require 'rbconfig'
Config::MAKEFILE_CONFIG['CC'] = 'g++'

require 'mkmf'
# $CFLAGS = "#{$CFLAGS} -Werror"

Config::CONFIG['CC'] = "g++"
Config::CONFIG['CPP'] = "g++ -E"

have_library('stdc++')

unless have_library('libyui', 'YUI::ui')
unless have_library('yui', 'YUI::widgetFactory', 'yui/YUI.h')
STDERR.puts "Cannot find libyui"
STDERR.puts "Is libyui-devel installed ?"
end
find_header 'YUI.h', '/usr/include/yui'

$CPPFLAGS = "-I/usr/include/yui -I.."

create_makefile('_yui')
13 changes: 13 additions & 0 deletions swig/yui.i
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,19 @@
#include <sstream>
#include <stdexcept>

#if defined(SWIGRUBY)

extern "C" {
/* Init_ for the %module, defined by Swig */
SWIGEXPORT void Init_yui(void);

/* Init_ for the .so lib, called by Ruby */
SWIGEXPORT void Init__yui(void) {
Init_yui();
}
}
#endif

#define YUILogComponent "bindings"
#include "yui/YUILog.h"

Expand Down

0 comments on commit 76cc85a

Please sign in to comment.