diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ac527cf..6e8d7240 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,6 +23,7 @@ option(MORPHO_GCSTRESSTEST "Stress tests the garbage collector" OFF) option(MORPHO_BUILD_LINALG "Builds with linear algebra" ON) option(MORPHO_BUILD_SPARSE "Builds with sparse matrix support" ON) option(MORPHO_BUILD_GEOMETRY "Builds with geometry library" ON) +option(MORPHO_BUILD_PROFILER "Builds with profiler" OFF) #------------------------------------------------------------------------------- # Process options @@ -53,6 +54,10 @@ if(MORPHO_BUILD_GEOMETRY) target_compile_definitions(morpho PUBLIC MORPHO_INCLUDE_GEOMETRY) endif() +if(MORPHO_BUILD_PROFILER) +target_compile_definitions(morpho PUBLIC _DEBUG_PROFILER) +endif() + #------------------------------------------------------------------------------- # BLAS and LAPACK #------------------------------------------------------------------------------- diff --git a/src/build.h b/src/build.h index 9c8e12c7..395794f2 100644 --- a/src/build.h +++ b/src/build.h @@ -185,4 +185,6 @@ //#define MORPHO_OPCODE_USAGE /** @brief Buiild with profile support */ -#define MORPHO_PROFILER +#ifdef _DEBUG_PROFILER + #define MORPHO_PROFILER +#endif