raulbocanegra commented on a change in pull request #7284:
URL: https://github.com/apache/arrow/pull/7284#discussion_r435516397



##########
File path: cpp/src/arrow/python/CMakeLists.txt
##########
@@ -87,6 +94,10 @@ add_arrow_lib(arrow_python
               EXTRA_INCLUDES
               "${ARROW_PYTHON_INCLUDES}")
 
+if(WIN32 AND TARGET arrow_python_shared AND NOT 
ARROW_USE_DEPRECATED_FIND_PYTHONLIBS)

Review comment:
       Well, the point here is that `PYTHON_LIBRARIES` was originally appended 
to `ARROW_PYTHON_SHARED_LINK_LIBS` as you can see on line 63 (red) above.
   Because of that, we ended in a situation in which we have two different 
kinds of items in the `ARROW_PYTHON_SHARED_LINK_LIBS` list, the first item is 
the target `arrow_shared` and a second item in the form of `debug`, `optimized` 
keyword followed by the library path. It is described at the first and last 
items in the list 
[here](https://cmake.org/cmake/help/latest/command/target_link_libraries.html#id2).
 
   I don't know if mixing different types of items in a list variable is 
supported, but the fact is that it fails, so I have to add that dependency on a 
second step here, after `add_arrow_lib`. We only need to do this on Windows, 
when we are not using the deprecated scripts, and of course, if the target is 
defined. 
   I know it is not the prettiest if branch you can find, but I couldn't find 
another way. 
   If the description of the problem above helps you finding a better solution 
I am happy to change it.

##########
File path: cpp/src/arrow/python/CMakeLists.txt
##########
@@ -60,7 +60,14 @@ endif()
 
 set(ARROW_PYTHON_SHARED_LINK_LIBS arrow_shared)
 if(WIN32)
-  list(APPEND ARROW_PYTHON_SHARED_LINK_LIBS ${PYTHON_LIBRARIES} 
${PYTHON_OTHER_LIBS})
+  if(ARROW_USE_DEPRECATED_FIND_PYTHONLIBS)
+    list(APPEND ARROW_PYTHON_SHARED_LINK_LIBS 
+         $<$<CONFIG:Debug>:${PYTHON_DEBUG_LIBRARIES}> 
+         $<$<CONFIG:Release>:${PYTHON_LIBRARIES}> 

Review comment:
       Hi, `PYTHON_DEBUG_LIBRARIES` is set on the deprecated 
`FindPythonLibsNew` script. If I don't use it here, it won't link against 
`python_d` and the linking stage will fail.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to