Author: rinrab
Date: Tue Jul  2 16:33:56 2024
New Revision: 1918853

URL: http://svn.apache.org/viewvc?rev=1918853&view=rev
Log:
On the 'cmake' branch: Follow-up to r1918852: Fix argument parsing of the
target_exports function.

After more experiments with the extractor, I found that arguments to the
target_exports function was passing incorrectly; the list of the
remaining exports were not working.

This problem can be fixed by removing the argument variable from the function
definition and using built-in CMake function `ARGN` for the remaining list.
This variable stores all remaining arguments passed to the function, except
declared arguments, in this case `target_name`. There is a similar to `ARGN`
variable, `ARGV`, but it is a little bit differ, because it contains all
variable passed to the function, including all declared in function definition
arguments.

* build/cmake/extractor.cmake
  (target_exports): CMake magic to pass the arguments to the extractor.py
   correctly.

Modified:
    subversion/branches/cmake/build/cmake/extractor.cmake

Modified: subversion/branches/cmake/build/cmake/extractor.cmake
URL: 
http://svn.apache.org/viewvc/subversion/branches/cmake/build/cmake/extractor.cmake?rev=1918853&r1=1918852&r2=1918853&view=diff
==============================================================================
--- subversion/branches/cmake/build/cmake/extractor.cmake (original)
+++ subversion/branches/cmake/build/cmake/extractor.cmake Tue Jul  2 16:33:56 
2024
@@ -1,6 +1,6 @@
 find_package(Python COMPONENTS Interpreter REQUIRED)
 
-function(target_exports target_name msvc_export)
+function(target_exports target_name)
   if (WIN32)
     set(def_file_path "${CMAKE_BINARY_DIR}/${target_name}.def")
 
@@ -11,13 +11,13 @@ function(target_exports target_name msvc
         "${Python_EXECUTABLE}"
       ARGS
         "build/generator/extractor.py"
-        ${msvc_exports}
+        ${ARGN}
         ">${def_file_path}"
       OUTPUT
         "${def_file_path}"
       DEPENDS
         "build/generator/extractor.py"
-        ${msvc_exports}
+        ${ARGN}
     )
 
     target_sources("${target_name}" PRIVATE "${def_file_path}")


Reply via email to