diff --git a/.github/workflows/CITest.yml b/.github/workflows/CITest.yml index 4858bf848..dd3f5b547 100644 --- a/.github/workflows/CITest.yml +++ b/.github/workflows/CITest.yml @@ -197,6 +197,14 @@ jobs: platform: windows python-arch: x64 python-version: '3.9' + diet_build: false + - name: 'windows x64 MSVC 64bit DIET' + os: windows-latest + arch: x64 + platform: windows + python-arch: x64 + python-version: '3.9' + diet_build: true steps: - uses: actions/checkout@v4 @@ -215,6 +223,6 @@ jobs: shell: bash run: | cmake --version - cmake --preset=${{ matrix.config.platform }}-x64 - cmake --build --preset build-${{ matrix.config.platform }}-release - cmake --build --preset install-${{ matrix.config.platform }}-release + cmake --preset=${{ matrix.config.platform }}-x64${{ matrix.config.diet_build == true && '-diet' || '' }} + cmake --build --preset build-${{ matrix.config.platform }}${{ matrix.config.diet_build == true && '-diet' || '' }}-release + cmake --build --preset install-${{ matrix.config.platform }}${{ matrix.config.diet_build == true && '-diet' || '' }}-release diff --git a/CMakePresets.json b/CMakePresets.json index ad7942ac0..5c0d54580 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -37,6 +37,18 @@ "strategy": "external" } }, + { + "name": "diet", + "hidden": true, + "displayName": "DIET", + "generator": "DIET build", + "cacheVariables": { + "CAPSTONE_BUILD_DIET": { + "type": "BOOL", + "value": "ON" + } + } + }, { "name": "linux-x64", "inherits": [ "ninja", "x64", "locations-base", "warnings-base" ], @@ -51,6 +63,11 @@ "name": "windows-x64", "inherits": [ "ninja", "x64", "locations-base", "warnings-base" ], "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, + { + "name": "windows-x64-diet", + "inherits": [ "ninja", "x64", "locations-base", "warnings-base", "diet" ], + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} } ], "buildPresets": [ @@ -72,6 +89,12 @@ "nativeToolOptions": [ "-v" ], "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} }, + { + "name": "build-windows-diet", + "configurePreset": "windows-x64-diet", + "nativeToolOptions": [ "-v" ], + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, { "name": "build-linux-release", "inherits": "build-linux", @@ -90,6 +113,12 @@ "configuration": "Release", "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} }, + { + "name": "build-windows-diet-release", + "inherits": "build-windows-diet", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, { "name": "install-linux", "configurePreset": "linux-x64", @@ -111,6 +140,13 @@ "targets": [ "install" ], "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} }, + { + "name": "install-windows-diet", + "configurePreset": "windows-x64-diet", + "inherits": "build-windows-diet", + "targets": [ "install" ], + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, { "name": "install-linux-release", "inherits": "install-linux", @@ -128,6 +164,12 @@ "inherits": "install-windows", "configuration": "Release", "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} + }, + { + "name": "install-windows-diet-release", + "inherits": "install-windows-diet", + "configuration": "Release", + "condition": {"type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows"} } ] } diff --git a/SStream.c b/SStream.c index 47ae08186..07824f28a 100644 --- a/SStream.c +++ b/SStream.c @@ -190,6 +190,8 @@ void SStream_concat0(SStream *ss, const char *s) ss->index += 1; ss->buffer[ss->index] = '\0'; } +#else + ss->buffer[ss->index] = '\0'; #endif } @@ -214,6 +216,8 @@ void SStream_concat1(SStream *ss, const char c) ss->buffer[ss->index] = '>'; ss->index++; } +#else + ss->buffer[ss->index] = '\0'; #endif } @@ -238,6 +242,8 @@ void SStream_concat(SStream *ss, const char *fmt, ...) ss->buffer[ss->index] = '>'; ss->index += 1; } +#else + ss->buffer[ss->index] = '\0'; #endif } diff --git a/arch/AArch64/AArch64Mapping.c b/arch/AArch64/AArch64Mapping.c index f40188508..29836fb9f 100644 --- a/arch/AArch64/AArch64Mapping.c +++ b/arch/AArch64/AArch64Mapping.c @@ -900,6 +900,7 @@ static void AArch64_add_cs_groups(MCInst *MI) static void AArch64_correct_mem_access(MCInst *MI) { +#ifndef CAPSTONE_DIET if (!detail_is_set(MI)) return; cs_ac_type access = @@ -913,6 +914,7 @@ static void AArch64_correct_mem_access(MCInst *MI) return; } } +#endif } void AArch64_printer(MCInst *MI, SStream *O, void * /* MCRegisterInfo* */ info)