Author: rinrab
Date: Sat Jun 29 16:30:49 2024
New Revision: 1918750
URL: http://svn.apache.org/viewvc?rev=1918750&view=rev
Log:
On the 'cmake' branch: Allow specific FS and RA modules to be disabled.
Now, it is possible to specify any of the following options when configuring
CMake. By default, they are set to ON, which means that they should be built,
but if they are set to OFF, this target would not be included to build and
not linked by other libraries.
Here is the list with all new options:
- SVN_BUILD_RA_LOCAL
- SVN_BUILD_RA_SERF
- SVN_BUILD_RA_SVN
- SVN_BUILD_FS_FS
- SVN_BUILD_FS_X
* build/cmake/options.cmake
(): Add options for building specific FS and RA modules and setup defines
based on them.
* build/generator/gen_cmake.py
(get_module_name): New function, for getting the name of the module.
(Generator.write): Setup enable_condition for FS and RA modules.
* subversion/svn_private_config.hc
(): Do not setup SVN_LIBSVN_**_LINKS_**_** defines, because they are
now set by using add_compile_definitions commands, directly from CMake.
Modified:
subversion/branches/cmake/build/cmake/options.cmake
subversion/branches/cmake/build/generator/gen_cmake.py
subversion/branches/cmake/subversion/svn_private_config.hc
Modified: subversion/branches/cmake/build/cmake/options.cmake
URL:
http://svn.apache.org/viewvc/subversion/branches/cmake/build/cmake/options.cmake?rev=1918750&r1=1918749&r2=1918750&view=diff
==============================================================================
--- subversion/branches/cmake/build/cmake/options.cmake (original)
+++ subversion/branches/cmake/build/cmake/options.cmake Sat Jun 29 16:30:49 2024
@@ -23,3 +23,29 @@ configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/subversion/svn_private_config.hc"
"${CMAKE_CURRENT_BINARY_DIR}/svn_private_config.h"
)
+
+option(SVN_BUILD_RA_LOCAL "Build Subversion Local Repository Access Library"
ON)
+if (SVN_BUILD_RA_LOCAL)
+ add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_LOCAL")
+endif()
+
+# TODO:
+# option(SVN_BUILD_RA_SERF "Build Subversion HTTP/WebDAV Protocol Repository
Access Library" OFF)
+# if (SVN_BUILD_RA_SERF)
+# add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_SERF")
+# endif()
+
+option(SVN_BUILD_RA_SVN "Build Subversion SVN Protocol Repository Access
Library" ON)
+if (SVN_BUILD_RA_SVN)
+ add_compile_definitions("SVN_LIBSVN_RA_LINKS_RA_SVN")
+endif()
+
+option(SVN_BUILD_FS_FS "Build Subversion FSFS Repository Filesystem Library"
ON)
+if (SVN_BUILD_FS_FS)
+ add_compile_definitions("SVN_LIBSVN_FS_LINKS_FS_FS")
+endif()
+
+option(SVN_BUILD_FS_X "Build Subversion FSX Repository Filesystem Library" ON)
+if (SVN_BUILD_FS_X)
+ add_compile_definitions("SVN_LIBSVN_FS_LINKS_FS_X")
+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=1918750&r1=1918749&r2=1918750&view=diff
==============================================================================
--- subversion/branches/cmake/build/generator/gen_cmake.py (original)
+++ subversion/branches/cmake/build/generator/gen_cmake.py Sat Jun 29 16:30:49
2024
@@ -60,6 +60,16 @@ def get_target_type(target: gen_base.Tar
else:
return str(type(target))
+def get_module_name(name: str):
+ """
+ Returns the name of the library as a module name. Module name
+ is a library name without `libsvn_` prefix and in upper case.
+ For example, for `libsvn_fs_fs`, the function would return
+ just `FS_FS`.
+ """
+
+ return name[7:].upper()
+
class Generator(gen_base.GeneratorBase):
_extension_map = {
('exe', 'target'): '.exe',
@@ -101,8 +111,10 @@ class Generator(gen_base.GeneratorBase):
else:
pass
elif isinstance(target, gen_base.TargetRaModule):
+ enable_condition = "SVN_BUILD_" + get_module_name(target.name);
group = "SVN_RA_MODULES"
elif isinstance(target, gen_base.TargetFsModule):
+ enable_condition = "SVN_BUILD_" + get_module_name(target.name);
group = "SVN_FS_MODULES"
elif isinstance(target, gen_base.TargetApacheMod):
pass
Modified: subversion/branches/cmake/subversion/svn_private_config.hc
URL:
http://svn.apache.org/viewvc/subversion/branches/cmake/subversion/svn_private_config.hc?rev=1918750&r1=1918749&r2=1918750&view=diff
==============================================================================
--- subversion/branches/cmake/subversion/svn_private_config.hc (original)
+++ subversion/branches/cmake/subversion/svn_private_config.hc Sat Jun 29
16:30:49 2024
@@ -58,18 +58,6 @@
/* Name of system's null device */
#define SVN_NULL_DEVICE_NAME "nul"
-/* Link fs fs library into the fs library */
-#define SVN_LIBSVN_FS_LINKS_FS_FS
-
-/* Link fs fs library into the fs library */
-#define SVN_LIBSVN_FS_LINKS_FS_X
-
-/* Link local repos access library to client */
-#define SVN_LIBSVN_RA_LINKS_RA_LOCAL
-
-/* Link pipe repos access library to client */
-#define SVN_LIBSVN_RA_LINKS_RA_SVN
-
/* Defined to be the path to the installed binaries */
#define SVN_BINDIR "/usr/local/bin"