Include a ruby library for OS X

See #560
develop
lethosor 2015-02-21 21:51:07 -05:00
parent d7897caec7
commit 6a64525284
4 changed files with 16 additions and 14 deletions

@ -1,16 +1,18 @@
IF (NOT APPLE) IF (APPLE)
IF (UNIX) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.osx.tar.gz
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.dylib)
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/libruby1.8.so.1.8.7 ${CMAKE_CURRENT_BINARY_DIR}/libruby.so) ELSEIF(UNIX)
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.so) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/libruby187.linux.tar.gz
ELSE (UNIX) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/libruby1.8.so.1.8.7 ${CMAKE_CURRENT_BINARY_DIR}/libruby.so)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.so)
FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll) ELSE()
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll) EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E tar xzf ${CMAKE_CURRENT_SOURCE_DIR}/msvcrtruby187.tar.gz
ENDIF(UNIX) WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(NOT APPLE) FILE(RENAME ${CMAKE_CURRENT_BINARY_DIR}/msvcrt-ruby18.dll ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll)
SET(RUBYLIB ${CMAKE_CURRENT_BINARY_DIR}/libruby.dll)
ENDIF()
IF (APPLE OR UNIX) IF (APPLE OR UNIX)
SET(RUBYAUTOGEN ruby-autogen-gcc.rb) SET(RUBYAUTOGEN ruby-autogen-gcc.rb)

@ -327,7 +327,7 @@ static int df_loadruby(void)
#if defined(WIN32) #if defined(WIN32)
"./libruby.dll"; "./libruby.dll";
#elif defined(__APPLE__) #elif defined(__APPLE__)
"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib"; "hack/libruby.dylib";
#else #else
"hack/libruby.so"; "hack/libruby.so";
#endif #endif