diff --git a/CMakeLists.txt b/CMakeLists.txt index bc1f73525..d6cc2ffae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,7 @@ option(ENABLE_WERROR "Enables -Werror" FALSE) option(ENABLE_STATIC_PIE "Enables static-pie build" FALSE) option(ENABLE_JEMALLOC "Enables jemalloc allocator" TRUE) option(ENABLE_OFFLINE_TELEMETRY "Enables FEX offline telemetry" TRUE) +option(ENABLE_COMPILE_TIME_TRACE "Enables time trace compile option" FALSE) set (X86_C_COMPILER "x86_64-linux-gnu-gcc" CACHE STRING "c compiler for compiling x86 guest libs") set (X86_CXX_COMPILER "x86_64-linux-gnu-g++" CACHE STRING "c++ compiler for compiling x86 guest libs") @@ -77,6 +78,11 @@ if (ENABLE_XRAY) link_libraries(-fxray-instrument) endif() +if (ENABLE_COMPILE_TIME_TRACE) + add_compile_options(-ftime-trace) + link_libraries(-ftime-trace) +endif() + set (PTHREAD_LIB pthread) if (ENABLE_LLD) set (LD_OVERRIDE "-fuse-ld=lld")