Skip to content

Commit

Permalink
Add CAPSTONE_DIET build test.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rot127 committed Jun 1, 2024
1 parent 1bacb5b commit 71e1469
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/CITest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ jobs:
python-arch: x64,
python-version: '3.9',
build-system: 'make',
enable-asan: 'OFF'
enable-asan: 'OFF',
diet-build: 'OFF'
}
- {
name: 'ubuntu-22.04 x64 python3.9 cmake',
Expand All @@ -54,7 +55,8 @@ jobs:
python-arch: x64,
python-version: '3.9',
build-system: 'cmake',
enable-asan: 'OFF'
enable-asan: 'OFF',
diet-build: 'OFF'
}
- {
name: 'ubuntu-22.04 x64 python3.11 cmake',
Expand All @@ -63,7 +65,8 @@ jobs:
python-arch: x64,
python-version: '3.11',
build-system: 'cmake',
enable-asan: 'OFF'
enable-asan: 'OFF',
diet-build: 'OFF'
}
- {
name: 'ubuntu-22.04 x64 python3.11 ASAN',
Expand All @@ -72,7 +75,18 @@ jobs:
python-arch: x64,
python-version: '3.11',
build-system: 'cmake',
enable-asan: 'ON'
enable-asan: 'ON',
diet-build: 'OFF'
}
- {
name: 'ubuntu-22.04 x64 python3.11 DIET + ASAN',
os: ubuntu-latest,
arch: x64,
python-arch: x64,
python-version: '3.11',
build-system: 'cmake',
enable-asan: 'ON',
diet-build: 'ON'
}

steps:
Expand Down Expand Up @@ -103,13 +117,14 @@ jobs:
if: startsWith(matrix.config.build-system, 'cmake')
env:
asan: ${{ matrix.config.enable-asan }}
diet_build: ${{ matrix.config.diet-build }}
run: |
mkdir build && cd build
# build static library
cmake -DCAPSTONE_INSTALL=1 -DCMAKE_INSTALL_PREFIX=/usr ..
cmake --build . --config Release
# build shared library
cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} ..
cmake -DCAPSTONE_INSTALL=1 -DBUILD_SHARED_LIBS=1 -DCMAKE_INSTALL_PREFIX=/usr -DCAPSTONE_BUILD_CSTEST=ON -DENABLE_ASAN=${asan} -DCAPSTONE_BUILD_DIET=${diet_build} ..
sudo cmake --build . --config Release --target install
cp libcapstone.* ../
cp libcapstone.* ../tests/
Expand All @@ -130,10 +145,14 @@ jobs:
run: |
sh suite/run_invalid_cstool.sh
- name: cstest (cmake)
- name: cstest (cmake) - MC regression
if: startsWith(matrix.config.build-system, 'cmake')
run: |
python suite/cstest/cstest_report.py -D -d suite/MC
- name: cstest (cmake) - details
if: startsWith(matrix.config.build-system, 'cmake') && startsWith(matrix.config.diet-build, 'OFF')
run: |
python suite/cstest/cstest_report.py -D -f suite/cstest/issues.cs
python suite/cstest/cstest_report.py -D -f tests/cs_details/issue.cs
Expand Down
2 changes: 1 addition & 1 deletion COMPILE_CMAKE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Get CMake for free from http://www.cmake.org.
Besides, Capstone also allows some more customization via following macros.

- CAPSTONE_USE_SYS_DYN_MEM: change this to OFF to use your own dynamic memory management.
- CAPSTONE_BUILD_DIET: change this to ON to make the binaries more compact.
- CAPSTONE_BUILD_DIET: change this to ON to make the binaries more compact. In exchange for no details.
- CAPSTONE_X86_REDUCE: change this to ON to make X86 binary smaller.
- CAPSTONE_X86_ATT_DISABLE: change this to ON to disable AT&T syntax on x86.
- CAPSTONE_DEBUG: change this to ON to enable extra debug assertions.
Expand Down

0 comments on commit 71e1469

Please sign in to comment.