Skip to content

Commit a81a5c1

Browse files
Merge pull request #313 from ivpravdin/dev
Add CMake option to build with profiler
2 parents 87e9e03 + de6119e commit a81a5c1

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ option(MORPHO_GCSTRESSTEST "Stress tests the garbage collector" OFF)
2323
option(MORPHO_BUILD_LINALG "Builds with linear algebra" ON)
2424
option(MORPHO_BUILD_SPARSE "Builds with sparse matrix support" ON)
2525
option(MORPHO_BUILD_GEOMETRY "Builds with geometry library" ON)
26+
option(MORPHO_BUILD_PROFILER "Builds with profiler" OFF)
2627

2728
#-------------------------------------------------------------------------------
2829
# Process options
@@ -53,6 +54,11 @@ if(MORPHO_BUILD_GEOMETRY)
5354
target_compile_definitions(morpho PUBLIC MORPHO_INCLUDE_GEOMETRY)
5455
endif()
5556
57+
# Build with profiler
58+
if(MORPHO_BUILD_PROFILER)
59+
target_compile_definitions(morpho PUBLIC _DEBUG_PROFILER)
60+
endif()
61+
5662
#-------------------------------------------------------------------------------
5763
# BLAS and LAPACK
5864
#-------------------------------------------------------------------------------

src/build.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,6 @@
185185
//#define MORPHO_OPCODE_USAGE
186186

187187
/** @brief Buiild with profile support */
188-
#define MORPHO_PROFILER
188+
#ifdef _DEBUG_PROFILER
189+
#define MORPHO_PROFILER
190+
#endif

0 commit comments

Comments
 (0)