]> code.bitgloo.com Git - clyne/stmdspgui.git/commitdiff
add formula disable flag
authorClyne Sullivan <clyne@bitgloo.com>
Mon, 23 May 2022 04:15:17 +0000 (20:15 -0800)
committerClyne Sullivan <clyne@bitgloo.com>
Mon, 23 May 2022 04:15:17 +0000 (20:15 -0800)
Makefile
source/device_formula.cpp

index 1f4b1e1e406a73cad243496db225cecf48b08395..6b8511133d6e7a0b43d3bbfb81983eda19c5fd24 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ OUTPUT := stmdspgui.exe
 CXXFLAGS := -std=c++20 -O2 \
             -Isource -Isource/imgui -Isource/stmdsp -Isource/serial/include \
             -Wall -Wextra -pedantic \
-            -DSTMDSP_WIN32 -Wa,-mbig-obj
+            -DSTMDSP_WIN32 -Wa,-mbig-obj -DSTMDSP_DISABLE_FORMULAS
 LDFLAGS = -mwindows -lSDL2 -lopengl32 -lsetupapi -lole32
 
 all: $(OUTPUT)
index 9a3372ff5bbf7943c26265e51cb89357f97b3cfb..e21d374cc9d2eb706941fc1f53a8b480568a5147 100644 (file)
  * If not, see <https://www.gnu.org/licenses/>.
  */
 
+#include "stmdsp.hpp"
+
+#include <algorithm>
+#include <random>
+#include <string_view>
+#include <vector>
+
+#ifndef STMDSP_DISABLE_FORMULAS
+
 #define exprtk_disable_comments
 #define exprtk_disable_break_continue
 #define exprtk_disable_sc_andor
 //#define exprtk_disable_caseinsensitivity
 #include "exprtk.hpp"
 
-#include "stmdsp.hpp"
-
-#include <algorithm>
-#include <random>
-#include <string_view>
-#include <vector>
-
 static std::random_device randomDevice;
 
 std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string& formulaString)
@@ -73,3 +75,12 @@ std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string& for
     return samples;
 }
 
+#else // no formula support
+
+std::vector<stmdsp::dacsample_t> deviceGenLoadFormulaEval(const std::string&)
+{
+    return {};
+}
+
+#endif // STMDSP_DISABLE_FORMULAS
+