blueloveTH 1 vuosi sitten
vanhempi
commit
907a1b7713
2 muutettua tiedostoa jossa 7 lisäystä ja 0 poistoa
  1. 4 0
      include/pocketpy/interpreter/profiler.hpp
  2. 3 0
      src/interpreter/profiler.cpp

+ 4 - 0
include/pocketpy/interpreter/profiler.hpp

@@ -1,7 +1,9 @@
 #pragma once
 
+#include "pocketpy/common/config.h"
 #include "pocketpy/interpreter/frame.hpp"
 
+#if PK_ENABLE_PROFILER
 #include <ctime>
 
 namespace pkpy {
@@ -38,3 +40,5 @@ struct LineProfiler {
 };
 
 }  // namespace pkpy
+
+#endif

+ 3 - 0
src/interpreter/profiler.cpp

@@ -1,5 +1,6 @@
 #include "pocketpy/interpreter/profiler.hpp"
 
+#if PK_ENABLE_PROFILER
 namespace pkpy {
 
 static std::string left_pad(std::string s, int width) {
@@ -126,3 +127,5 @@ LineProfiler::~LineProfiler() {
 }
 
 }  // namespace pkpy
+
+#endif