svn commit: r1920764 - /subversion/trunk/CMakeLists.txt

[email protected]
Newsgroups gmane.comp.version-control.subversion.svn
Message-ID <[email protected]>
Author: jun66j5
Date: Wed Sep 18 07:23:19 2024
New Revision: 1920764

URL: http://svn.apache.org/viewvc?rev=1920764&view=rev
Log:
cmake: Fix CMakeLists.txt to generate *.def files that have the same exported
symbols as build/generator/extractor.py.

* CMakeLists.txt
  (target_exports): Fix regular expression for exported symbols.

Modified:
    subversion/trunk/CMakeLists.txt

Modified: subversion/trunk/CMakeLists.txt
URL: http://svn.apache.org/viewvc/subversion/trunk/CMakeLists.txt?rev=1920764&r1=1920763&r2=1920764&view=diff
==============================================================================
--- subversion/trunk/CMakeLists.txt (original)
+++ subversion/trunk/CMakeLists.txt Wed Sep 18 07:23:19 2024
@@ -412,15 +412,16 @@ function(target_exports target_name)
     set(def_file_path ${CMAKE_BINARY_DIR}/${target_name}.def)
 
     # see build/generator/extractor.py
-    set(func_regex "^([A-Za-z0-9_][A-Za-z0-9_* ]+[ *])?(svn[A-Za-z0-9_]+)\\(")
+    set(func_regex "(^|\n)((([A-Za-z0-9_]+|[*]) )+[*]?)?((svn|apr)_[a-z_0-9]+)[ \t\r\n]*\\(")
 
     set(defs)
     foreach(file ${ARGN})
-      file(STRINGS ${file} funcs REGEX "${func_regex}")
+      file(READ ${file} contents)
+      string(REGEX MATCHALL "${func_regex}" funcs ${contents})
 
       foreach(func_string ${funcs})
-        string(REGEX REPLACE "${func_regex}.*$" "\\2" func_name ${func_string})
-
+        string(REGEX MATCH "[A-Za-z0-9_]+[ \t\r\n]*\\($" func_name ${func_string})
+        string(REGEX REPLACE "[ \t\r\n]*\\($" "" func_name ${func_name})
         list(APPEND defs "${func_name}")
       endforeach()
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.