[PATCH] D77346: [docs] Corrected inaccuracies in Common Problems section

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 12:53:02 PDT 2020


Meinersbur added inline comments.


================
Comment at: llvm/docs/GettingStarted.rst:1116
+    - Debug --- This is the default build type. This disables optimizations while
+      compiling LLVM, enables assertions, and enables debug info.
+    
----------------
e-leclercq wrote:
> Meinersbur wrote:
> > assertions are controlled by `LLVM_ENABLE_ASSERTIONS`, not `CMAKE_BUILD_TYPE`
> I read in the CMake.html doc [[ https://llvm.org/docs/CMake.html#llvm-specific-variables | here ]] that LLVM_ENABLE_ASSERTIONS defaults to ON iff the build type is Debug
Yes, it defaults to ON/OFF depending on CMAKE_BUILD_TYPE, but once the CMakeCache.txt has been created, it will not change when CMAKE_BUILD_TYPE is changed.

I recommend not to rely on the default value if you want to have it a specific value.


================
Comment at: llvm/docs/GettingStarted.rst:1121
+    - Release --- Turns on optimizations and disables debug info. Combining 
+      the Release build type with -DLLVM_ENABLE_ASSERTIONS may be a good 
+      trade-off between speed and debugability during development, particularly 
----------------
Don't forget the `=ON` part for `-DLLVM_ENABLE_ASSERTIONS`. The cmake invocation will fail without an argument.

(btw, cmake interprets the empty string as false)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77346/new/

https://reviews.llvm.org/D77346





More information about the llvm-commits mailing list