From 1130186c9e9743935da8ca7b9cb4d1c58343be1e Mon Sep 17 00:00:00 2001 From: Christian Seiler Date: Fri, 15 May 2026 17:52:18 +0200 Subject: [PATCH] C++/CMake: don't build structured code in embedded systems --- cpp/src/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cpp/src/CMakeLists.txt b/cpp/src/CMakeLists.txt index b0ebe6c..c6076bb 100644 --- a/cpp/src/CMakeLists.txt +++ b/cpp/src/CMakeLists.txt @@ -1,12 +1,10 @@ set(monoformat_SOURCES monoformat_schema.cpp - monoformat_structured.cpp monoformat_parseonly.cpp monoformat_fontreader.cpp ) set(monoformat_HEADERS monoformat_schema.hpp - monoformat_structured.hpp monoformat_parsehelpers.hpp monoformat_parseonly.hpp monoformat_fontreader.hpp @@ -14,6 +12,18 @@ set(monoformat_HEADERS monoformat_utf8.hpp ) +option(MONOFORMAT_EMBEDDED "Only build for embedded devices" FALSE) + +if(NOT MONOFORMAT_EMBEDDED) + list(APPEND monoformat_SOURCES + monoformat_structured.cpp + ) + + list(APPEND monoformat_HEADERS + monoformat_structured.hpp + ) +endif() + add_library(monoformat ${monoformat_SOURCES} ${monoformat_HEADERS}) target_compile_features(monoformat PUBLIC cxx_std_23) target_include_directories(monoformat PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})