Author: rinrab
Date: Tue Jul  2 22:35:56 2024
New Revision: 1918862

URL: http://svn.apache.org/viewvc?rev=1918862&view=rev
Log:
On the 'cmake' branch: Support build type customization for modules.

Add SVN_BUILD_SHARED_FS and SVN_BUILD_SHARED_RA options that allow to
customize the build type of the FS and RA modules.

Now, it is impossible to build RA modules statically, because they doesn't
support it.

The SVN_BUILD_SHARED_FS option defaults to ON when BUILD_SHARED_LIBS and to
OFF in other case. This is similar to simply defaulting this option to the
value of BUILD_SHARED_LIBS option. The SVN_BUILD_SHARED_RA option always
defaults to OFF, because it doesn't support shared build. In addition, adding
a warning when SVN_BUILD_SHARED_RA is set to true.

* build/cmake/options.cmake
  (): Add the options, explained above.
  (): Initialize SVN_FS_BUILD_TYPE and SVN_RA_BUILD_TYPE CMake variable, based
   on the options explained above.
  (): Write FATAL_ERROR if SVN_BUILD_SHARED_RA is set to true. 

* build/generator/gen_cmake.py
  (Generator.write): Set build_type to SVN_**_BUILD_TYPE for FS and RA modules.
  (Generator.write): Minor rework in sequence of build_type initialization.

Modified:
    subversion/branches/cmake/build/cmake/options.cmake
    subversion/branches/cmake/build/generator/gen_cmake.py

Modified: subversion/branches/cmake/build/cmake/options.cmake
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/build/cmake/options.cmake?rev=1918862&r1=1918861&r2=1918862&view=diff
==============================================================================
--- subversion/branches/cmake/build/cmake/options.cmake (original)
+++ subversion/branches/cmake/build/cmake/options.cmake Tue Jul  2 22:35:56 2024
@@ -55,3 +55,21 @@ option(SVN_BUILD_TOOLS "Build Subversion
 option(SVN_BUILD_TEST "Build Subversion test-suite" OFF)
 
 option(BUILD_SHARED_LIBS "Build using shared libraries" ON)
+
+option(SVN_BUILD_SHARED_FS "Build shared FS modules" ${BUILD_SHARED_LIBS})
+if(SVN_BUILD_SHARED_FS)
+  set(SVN_FS_BUILD_TYPE SHARED)
+else()
+  set(SVN_FS_BUILD_TYPE STATIC)
+endif()
+
+option(SVN_BUILD_SHARED_RA "Build shared RA modules" OFF)
+if(SVN_BUILD_SHARED_RA)
+  set(SVN_RA_BUILD_TYPE SHARED)
+else()
+  set(SVN_RA_BUILD_TYPE STATIC)
+endif()
+
+if(SVN_BUILD_SHARED_RA)
+  message(FATAL_ERROR "SVN_BUILD_SHARED_RA not yet supported")
+endif()

Modified: subversion/branches/cmake/build/generator/gen_cmake.py
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/build/generator/gen_cmake.py?rev=1918862&r1=1918861&r2=1918862&view=diff
==============================================================================
--- subversion/branches/cmake/build/generator/gen_cmake.py (original)
+++ subversion/branches/cmake/build/generator/gen_cmake.py Tue Jul  2 22:35:56 
2024
@@ -120,11 +120,16 @@ class Generator(gen_base.GeneratorBase):
       elif isinstance(target, gen_base.TargetRaModule):
         enable_condition = "SVN_BUILD_" + get_module_name(target.name);
         group = "SVN_RA_MODULES"
+        build_type = " ${SVN_RA_BUILD_TYPE}"
       elif isinstance(target, gen_base.TargetFsModule):
         enable_condition = "SVN_BUILD_" + get_module_name(target.name);
         group = "SVN_FS_MODULES"
+        build_type = " ${SVN_FS_BUILD_TYPE}"
       elif isinstance(target, gen_base.TargetApacheMod):
         pass
+      elif isinstance(target, gen_base.TargetLib):
+        if target.msvc_static:
+          build_type = " STATIC"
 
       msvc_export = []
       if isinstance(target, gen_base.TargetLib):
@@ -132,9 +137,6 @@ class Generator(gen_base.GeneratorBase):
           path = "subversion/include/" + export.replace("\\", "/")
           msvc_export.append(path)
 
-        if target.msvc_static:
-          build_type = " STATIC"
-
       sources = []
       libs = []
 


Reply via email to