From 1cdf280fcf0c8fee209f37bc835880471186218b Mon Sep 17 00:00:00 2001 From: momo5502 Date: Tue, 1 Apr 2025 18:49:41 +0200 Subject: [PATCH] Support disabling rust code --- CMakeLists.txt | 7 +------ README.md | 1 + cmake/compiler-env.cmake | 16 ++++++++++++++++ src/CMakeLists.txt | 7 +++++-- src/windows-emulator/CMakeLists.txt | 5 +++++ src/windows-emulator/windows_emulator.cpp | 3 +++ 6 files changed, 31 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a4149da5..2168ae43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,18 +4,13 @@ cmake_minimum_required(VERSION 3.26.4) option(MOMO_ENABLE_SANITIZER "Enable sanitizer" OFF) option(MOMO_ENABLE_CLANG_TIDY "Enable clang-tidy checks" OFF) +option(MOMO_ENABLE_RUST_CODE "Enable code parts written in rust" ON) option(MOMO_BUILD_AS_LIBRARY "Configure and Build the emulator as a shared library (without the samples and tests)" OFF) set(MOMO_REFLECTION_LEVEL "0" CACHE STRING "Reflection level for the build") message(STATUS "Reflection level is set to: ${MOMO_REFLECTION_LEVEL}") add_compile_definitions(MOMO_REFLECTION_LEVEL=${MOMO_REFLECTION_LEVEL}) -if(MOMO_BUILD_AS_LIBRARY) - add_compile_definitions(MOMO_BUILD_AS_LIBRARY=1) -else() - add_compile_definitions(MOMO_BUILD_AS_LIBRARY=0) -endif() - ########################################## set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) diff --git a/README.md b/README.md index 8bd6d61f..b423ea97 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ Click + +#if MOMO_ENABLE_RUST_CODE #include +#endif #include #include