authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-22 12:11:28-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2021-06-23 10:44:46-07:00
logc3f637a54cbb36c5dd6ec9e772ddc0930316d790
tree8281f0cfd1b4a9f493a065ffa40d0bd1a548c770
parent96ebf9396f31c8645a2d0f064f211a25796f4c3e

cmake: debug builds of zig enable logging by default

when logging is enabled, the --debug-log flag is available.

1 files changed, 6 insertions(+), 1 deletions(-)

CMakeLists.txt+6-1
...@@ -91,7 +91,12 @@ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries...@@ -91,7 +91,12 @@ set(ZIG_TARGET_MCPU "baseline" CACHE STRING "-mcpu parameter to output binaries
91set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")91set(ZIG_EXECUTABLE "" CACHE STRING "(when cross compiling) path to already-built zig binary")
92set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")92set(ZIG_SINGLE_THREADED off CACHE BOOL "limit the zig compiler to use only 1 thread")
93set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")93set(ZIG_OMIT_STAGE2 off CACHE BOOL "omit the stage2 backend from stage1")
94set(ZIG_ENABLE_LOGGING off CACHE BOOL "enable logging")94
95if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
96 set(ZIG_ENABLE_LOGGING ON CACHE BOOL "enable logging")
97else()
98 set(ZIG_ENABLE_LOGGING OFF CACHE BOOL "enable logging")
99endif()
95100
96if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")101if("${ZIG_TARGET_TRIPLE}" STREQUAL "native")
97 set(ZIG_USE_LLVM_CONFIG ON CACHE BOOL "use llvm-config to find LLVM libraries")102 set(ZIG_USE_LLVM_CONFIG ON CACHE BOOL "use llvm-config to find LLVM libraries")