build: Add NOMINMAX definition for MSVC compatibility#478
build: Add NOMINMAX definition for MSVC compatibility#478siposcsaba89 wants to merge 1 commit intostotko:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #478 +/- ##
==========================================
- Coverage 96.64% 96.60% -0.04%
==========================================
Files 33 33
Lines 2622 2622
==========================================
- Hits 2534 2533 -1
- Misses 88 89 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks! I'm a bit hesitant to merge this fix since I don't believe that the proposed preprocessor definition should belong to stdgpu. In fact, the culprit is the |
Sorry, thad I did not give you more detailed description. I am trying to port our project to compile with cuda 13, and I belive that thrust and cuda in version 13 includes windows.h or some header from windows that defines min, max, which breaks our build. I understand, that you are hesitant, and I tought about that too, that it could break other cases, could give warning from already defined macros, etc., but if I do not set it, it won't compile. Maybe a pragma pop, push solution would be better, that's how nvidia does it, so I think you are right not to merge it, let me see if I can provide a better solution. |
This pull request makes a small build configuration change to the
src/stdgpu/CMakeLists.txtfile. The main update is the addition of a preprocessor definition to prevent macro conflicts when building with MSVC.NOMINMAXpreprocessor definition for MSVC builds to prevent conflicts with theminandmaxmacros defined in Windows headers. (src/stdgpu/CMakeLists.txt)