svn commit: r1920573 - /subversion/branches/cmake/CMakeLists.txt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: rinrab
Date: Wed Sep 11 18:03:53 2024
New Revision: 1920573

URL: http://svn.apache.org/viewvc?rev=1920573&view=rev
Log:
On the 'cmake' branch: Support compilation of Ruby swig bindings with CMake.

Note: the build hasn't success in my Windows environment due to a problem
with CRT, however works correctly on Linux. By the way, I am not sure that it
was actually working on Windows before.

* CMakeLists.txt
  (swig.ruby): Add finding of ruby libs and create an interface target for it.

Modified:
    subversion/branches/cmake/CMakeLists.txt

Modified: subversion/branches/cmake/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/branches/cmake/CMakeLists.txt?rev=1920573&r1=1920572&r2=1920573&view=diff
==============================================================================
--- subversion/branches/cmake/CMakeLists.txt (original)
+++ subversion/branches/cmake/CMakeLists.txt Wed Sep 11 18:03:53 2024
@@ -375,6 +375,21 @@ if(SVN_ENABLE_SWIG_PERL)
   swig_target_external_runtime(external-perl perl)
 endif()
 
+if(SVN_ENABLE_SWIG_RUBY)
+  find_package(Ruby REQUIRED)
+
+  add_library(external-ruby IMPORTED INTERFACE)
+  target_include_directories(external-ruby INTERFACE
+    ${Ruby_INCLUDE_DIRS}
+    ${SWIG_INCLUDE_DIRECTORIES}
+    ${CMAKE_CURRENT_SOURCE_DIR}/subversion/bindings/swig/ruby/libsvn_swig_ruby
+  )
+  target_compile_definitions(external-ruby INTERFACE HAVE_RB_ERRINFO)
+  target_link_libraries(external-ruby INTERFACE ${Ruby_LIBRARY})
+
+  swig_target_external_runtime(external-ruby ruby)
+endif()
+
 function(target_exports target_name)
   if (WIN32)
     set(filter_names
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.