Add debug tracing feature

It's disabled by default, use -DUNICORN_TRACER=on to enable it
This commit is contained in:
mio
2022-01-18 19:35:43 +01:00
parent abb958cac1
commit 28e791a37f
6 changed files with 149 additions and 1 deletions

View File

@ -131,7 +131,10 @@ def build_libraries():
os.mkdir(BUILD_DIR)
conf = 'Debug' if os.getenv('DEBUG', '') else 'Release'
subprocess.check_call(["cmake", '-B', BUILD_DIR, "-DCMAKE_BUILD_TYPE=" + conf])
cmake_args = ["cmake", '-B', BUILD_DIR, "-DCMAKE_BUILD_TYPE=" + conf]
if os.getenv("TRACE", ""):
cmake_args += ["-DUNICORN_TRACER=on"]
subprocess.check_call(cmake_args)
os.chdir(BUILD_DIR)
threads = os.getenv("THREADS", "4")
subprocess.check_call(["cmake", "--build", ".", "-j" + threads])