save-buffer commented on a change in pull request #12605:
URL: https://github.com/apache/arrow/pull/12605#discussion_r824063473



##########
File path: cpp/cmake_modules/ThirdpartyToolchain.cmake
##########
@@ -1844,10 +1844,14 @@ macro(build_gtest)
   set(GTEST_VENDORED TRUE)
   set(GTEST_CMAKE_CXX_FLAGS ${EP_CXX_FLAGS})
 
-  if(CMAKE_BUILD_TYPE MATCHES DEBUG)
-    set(CMAKE_GTEST_DEBUG_EXTENSION "d")
+  if(NOT CMAKE_GENERATOR STREQUAL Xcode)
+    if(CMAKE_BUILD_TYPE MATCHES DEBUG)
+      set(CMAKE_GTEST_DEBUG_EXTENSION "d")
+    else()
+      set(CMAKE_GTEST_DEBUG_EXTENSION "")
+    endif()
   else()
-    set(CMAKE_GTEST_DEBUG_EXTENSION "")
+    set(CMAKE_GTEST_DEBUG_EXTENSION "d")

Review comment:
       As far as I can tell, it's because Xcode selects whether to build in 
debug or release mode after configuration, so if it's not set then it will 
succeed building in Release but not in Debug because it'll try to find 
`libgtest.dylib` instead of `libgtestd.dylib`. Without this change, if I 
specified `-DCMAKE_BUILD_TYPE=Debug`, Xcode would be able to build in debug 
mode but not release mode. 




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to