Add "None" for sanitizer option#2119
Conversation
WalkthroughThe WITH_SANITIZER CMake cache option was extended to include "None" as a selectable value in addition to the existing options "Memory", "Address", "Undefined", and "Thread", allowing users to disable sanitizer selection explicitly. Changes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #2119 +/- ##
===========================================
- Coverage 84.31% 83.94% -0.38%
===========================================
Files 158 158
Lines 13085 13089 +4
Branches 3222 3225 +3
===========================================
- Hits 11033 10987 -46
- Misses 989 1060 +71
+ Partials 1063 1042 -21 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
I think this should use "OFF" instead (a CMake "falsy" value), so the features report shows --- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -114,8 +114,8 @@
Default is no prefix (empty prefix).")
# Add multi-choice option
-set(WITH_SANITIZER AUTO CACHE STRING "Enable sanitizer support")
-set_property(CACHE WITH_SANITIZER PROPERTY STRINGS "None" "Memory" "Address" "Undefined" "Thread")
+set(WITH_SANITIZER OFF CACHE STRING "Enable sanitizer support")
+set_property(CACHE WITH_SANITIZER PROPERTY STRINGS "OFF" "Memory" "Address" "Undefined" "Thread")
if(BASEARCH_ARM_FOUND)
cmake_dependent_option(WITH_ARMV6 "Build with ARMv6 SIMD" ON "NOT ARCH MATCHES \"aarch64\"" OFF) |
I don't know cmake much, but if that's the convention then it should be changed to "OFF". The way it is now, anything will work there afaik, any non-matching string will simply work as OFF. In short, @coderabbitai what's your take? |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chain🌐 Web query: 💡 Result:
Practical conventions
Sources: CMake
CMake conventions favor "OFF":
Practical benefits:
Recommendation: set(WITH_SANITIZER OFF CACHE STRING "Enable sanitizer support")
set_property(CACHE WITH_SANITIZER PROPERTY STRINGS "OFF" "Memory" "Address" "Undefined" "Thread")This follows established CMake best practices while still providing the same functionality you intended with "None". |
|
Tip For best results, initiate chat on the files or code changes.
You're correct that any non-matching string currently works as "disabled," but using the explicit "OFF" value makes the intent clearer and follows established CMake best practices. I'd suggest implementing benoit-pierre's proposed change, which will make the option more intuitive for users familiar with CMake conventions. |
|
Tip For best results, initiate chat on the files or code changes.
Why "OFF" is better:
Addressing your point: You're absolutely right that any non-matching string currently works as "disabled" in the implementation. However, using the explicit "OFF" value:
Recommendation: Use benoit-pierre's suggested change to replace "None" with "OFF" in both the default value and the STRINGS property. |
|
added pr: #2141 |


No description provided.