mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: fix detection of Ruby 3.0 on macOS (issue #1721)
This commit is contained in:
@@ -33,10 +33,13 @@ endif()
|
||||
|
||||
find_package(PkgConfig)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_search_module(RUBY ruby-3.0 ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9)
|
||||
endif()
|
||||
|
||||
if(RUBY_FOUND)
|
||||
set(RUBY_LIB "")
|
||||
mark_as_advanced(RUBY_LIB)
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# set specific search path for macOS
|
||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:/usr/local/opt/ruby/lib/pkgconfig")
|
||||
endif()
|
||||
pkg_search_module(RUBY ruby-3.0 ruby-2.7 ruby-2.6 ruby-2.5 ruby-2.4 ruby-2.3 ruby-2.2 ruby-2.1 ruby-2.0 ruby-1.9 ruby)
|
||||
if(RUBY_FOUND AND ${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
# FIXME: weird hack: hardcoding the Ruby lib location on macOS
|
||||
set(RUBY_LDFLAGS "${RUBY_LDFLAGS} -L/usr/local/opt/ruby/lib")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -25,9 +25,7 @@ set_target_properties(ruby PROPERTIES PREFIX "")
|
||||
|
||||
if(RUBY_FOUND)
|
||||
include_directories(${RUBY_INCLUDE_DIRS})
|
||||
set(LINK_LIBS)
|
||||
list(APPEND LINK_LIBS ${RUBY_LDFLAGS})
|
||||
target_link_libraries(ruby ${LINK_LIBS} ${RUBY_LIB} weechat_plugins_scripts coverage_config)
|
||||
target_link_libraries(ruby ${RUBY_LDFLAGS} weechat_plugins_scripts coverage_config)
|
||||
endif(RUBY_FOUND)
|
||||
|
||||
install(TARGETS ruby LIBRARY DESTINATION ${WEECHAT_LIBDIR}/plugins)
|
||||
|
||||
Reference in New Issue
Block a user