llvm.org GIT mirror llvm / a86576d
Fix cmake's multi-config generators after r326738 LLVM_ENABLE_STATS isn't known at configure-time in these generators so we must defer it to build-time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326936 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Sanders 2 years ago
3 changed file(s) with 9 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
881881 endfunction()
882882 get_compile_definitions()
883883
884 # The default for LLVM_ENABLE_STATS depends on whether NDEBUG is defined or not.
885 # LLVM_ENABLE_ASSERTIONS controls that so re-use it as the default.
886 option(LLVM_ENABLE_STATS "Enable statistics collection" ${LLVM_ENABLE_ASSERTIONS})
884 option(LLVM_FORCE_ENABLE_STATS "Enable statistics collection for builds that wouldn't normally enable it" OFF)
3030 #include
3131 #include
3232 #include
33
34 // Determine whether statistics should be enabled. We must do it here rather
35 // than in CMake because multi-config generators cannot determine this at
36 // configure time.
37 #if !defined(NDEBUG) || LLVM_FORCE_ENABLE_STATS
38 #define LLVM_ENABLE_STATS 1
39 #endif
3340
3441 namespace llvm {
3542
7979 /* Whether LLVM records statistics for use with GetStatistics(),
8080 * PrintStatistics() or PrintStatisticsJSON()
8181 */
82 #cmakedefine01 LLVM_ENABLE_STATS
82 #cmakedefine01 LLVM_FORCE_ENABLE_STATS
8383
8484 #endif