westonpace removed a comment on pull request #12605:
URL: https://github.com/apache/arrow/pull/12605#issuecomment-1074554560


   I'm not sure this change, as it stands, does anything.  But I am no cmake 
expert.  `GENERATOR_IS_MULTI_CONFIG` is a global property and not a variable.  
So, there is no variable named `GENERATOR_IS_MULTI_CONFIG` and so it defaults 
to `""`.  So it will never affect the if statement because it will always be 
false.
   
   On my Windows machine it doesn't matter if I'm using the VS generator or the 
Ninja generator, it still sets `CMAKE_GTEST_DEBUG_EXTENSION` based on 
`CMAKE_BUILD_TYPE`.
   
   On the other hand, if I do (note this is what we do later on in the line 
1941 link @kou provided)...
   
   ```
   get_property(_GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY 
GENERATOR_IS_MULTI_CONFIG)
   if(_GENERATOR_IS_MULTI_CONFIG)
   ```
   
   ...then it does recognize the property.  However, if I then try and build in 
release mode, it fails because it can't find the file.  So all this does is 
switch multi-config generators from "always fails when building debug" to 
"always fails when building release".  You claim `Multiconfiguration generators 
always want the flag set` but I'm not sure that statement is true.  A 
multi-configuration generator wants `gtestd.dll` if run with `--config Debug` 
and it wants `gtest.dll` if run with `--config Release`.  There is no way to 
know, at configuration time, what will be needed at runtime.
   
   So if we are going to build gtest at configuration time (which we need to do 
if we want to use gtest for test discovery) then we either need to build both 
versions if it is multi-config or we need to always build one version but only 
use that version for test discovery and not for a runtime dependency.


-- 
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: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to