From 6db73042545b6aa61949a137e886f55b177e8bb1 Mon Sep 17 00:00:00 2001 From: chentianya Date: Tue, 18 Aug 2026 17:48:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20GCC=20CMake=20presets?= =?UTF-8?q?=EF=BC=8C=E9=A1=B6=E5=B1=82=E5=85=88=E5=8F=AA=E7=BC=96=20isa?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit compiler/vm/host 尚未成库,避免 configure 失败。 Co-authored-by: Cursor --- CMakeLists.txt | 6 +++--- CMakePresets.json | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 CMakePresets.json diff --git a/CMakeLists.txt b/CMakeLists.txt index b263b91..cfd9226 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,6 @@ project(Stator include("${CMAKE_SOURCE_DIR}/cmake/Standards.cmake") add_subdirectory(isa) -add_subdirectory(compiler) -add_subdirectory(vm) -add_subdirectory(host) \ No newline at end of file +# add_subdirectory(compiler) +# add_subdirectory(vm) +# add_subdirectory(host) \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json new file mode 100644 index 0000000..e150da9 --- /dev/null +++ b/CMakePresets.json @@ -0,0 +1,48 @@ +{ + "version": 3, + "cmakeMinimumRequired": { + "major": 3, + "minor": 21, + "patch": 0 + }, + "configurePresets": [ + { + "name": "gcc", + "hidden": true, + "generator": "Ninja", + "binaryDir": "${sourceDir}/build/${presetName}", + "cacheVariables": { + "CMAKE_C_COMPILER": "gcc", + "CMAKE_CXX_COMPILER": "g++" + } + }, + { + "name": "gcc-debug", + "displayName": "GCC Debug", + "description": "使用 PATH 中的 gcc / g++,Debug", + "inherits": "gcc", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "gcc-release", + "displayName": "GCC Release", + "description": "使用 PATH 中的 gcc / g++,Release", + "inherits": "gcc", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "gcc-debug", + "configurePreset": "gcc-debug" + }, + { + "name": "gcc-release", + "configurePreset": "gcc-release" + } + ] +}