-
-
Notifications
You must be signed in to change notification settings - Fork 430
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add meson build system support (#525)
- Loading branch information
Showing
13 changed files
with
698 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,14 +11,13 @@ jobs: | |
name: >- | ||
CMake build + tests (${{ matrix.image_name }} ${{ matrix.cmake_flags }}) | ||
runs-on: ${{ matrix.image_name }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
# Do a regular and a no-libc build for each platform. | ||
- image_name: macOS-latest | ||
- image_name: macOS-latest | ||
- image_name: macos-latest | ||
- image_name: macos-latest | ||
cmake_flags: -DZYAN_NO_LIBC=ON | ||
skip_tests: yes | ||
- image_name: windows-2022 | ||
|
@@ -39,7 +38,7 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: { submodules: recursive } | ||
- name: Configuring | ||
run: | | ||
|
@@ -53,16 +52,70 @@ jobs: | |
cd build | ||
ctest -C Release --output-on-failure | ||
meson-build-and-tests: | ||
name: >- | ||
Meson build + tests (${{ matrix.platform }}, ${{ matrix.flavor }} ${{ matrix.mode.name }}) | ||
runs-on: ${{ matrix.platform }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
flavor: | ||
- debug | ||
- release | ||
mode: | ||
- { name: default, args: -Dtests=enabled } | ||
- { name: NO_LIBC, args: -Dnolibc=true } | ||
platform: | ||
- macos-latest | ||
- windows-2022 | ||
- ubuntu-22.04 | ||
extra_envs: | ||
- {} | ||
include: | ||
# Do a few more specialized configurations. | ||
- platform: ubuntu-22.04 | ||
mode: | ||
- name: minimal | ||
args: -Dminimal=enabled -Ddecoder=enabled -Davx512=enabled -Dknc=enabled -Dsegment=enabled -Dtests=enabled | ||
extra_envs: {} | ||
flavor: minsize | ||
exclude: | ||
- platform: macos-latest | ||
mode: { name: NO_LIBC, args: -Dnolibc=true } | ||
|
||
steps: | ||
- name: Setup meson | ||
run: | | ||
pipx install meson ninja | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: { submodules: recursive } | ||
- name: Activate MSVC and Configure | ||
if: ${{ matrix.platform == 'windows-2022' }} | ||
env: ${{ matrix.extra_envs }} | ||
run: | | ||
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }} --vsenv | ||
- name: Configuring | ||
if: ${{ matrix.platform != 'windows-2022' }} | ||
run: | | ||
meson setup build-${{ matrix.flavor }} --buildtype=${{ matrix.flavor }} ${{ matrix.mode.args }} | ||
- name: Building | ||
run: | | ||
meson compile -C build-${{ matrix.flavor }} | ||
- name: Running tests | ||
run: | | ||
meson test -C build-${{ matrix.flavor }} | ||
msbuild-build: | ||
name: MSBuild build (windows-2022) | ||
runs-on: windows-2022 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: { submodules: recursive } | ||
- name: Add msbuild to PATH | ||
uses: microsoft/[email protected] | ||
with: { vs-version: '[17,]' } | ||
with: { vs-version: "[17,]" } | ||
- name: Build user-mode | ||
run: | | ||
cd msvc | ||
|
@@ -77,7 +130,7 @@ jobs: | |
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: { submodules: recursive } | ||
- name: Amalgamating sources | ||
run: | | ||
|
@@ -109,7 +162,7 @@ jobs: | |
dry-run: false | ||
sanitizer: ${{ matrix.sanitizer }} | ||
- name: Upload Crash | ||
uses: actions/upload-artifact@v1 | ||
uses: actions/upload-artifact@v4 | ||
if: failure() && steps.build.outcome == 'success' | ||
with: | ||
name: ${{ matrix.sanitizer }}-artifacts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
@INCLUDE = "@TOP_SRCDIR@/Doxyfile" | ||
PROJECT_NUMBER = @VERSION@ | ||
PROJECT_BRIEF = "Zyan Disassembler Library" | ||
OUTPUT_DIRECTORY = "@TOP_BUILDDIR@/doc" | ||
STRIP_FROM_PATH = "@TOP_SRCDIR@" | ||
STRIP_FROM_INC_PATH = "@ZYCORE_INCLUDE_PATH@" | ||
INPUT = "@TOP_SRCDIR@/include" \ | ||
"@TOP_SRCDIR@/README.md" \ | ||
"@TOP_SRCDIR@/files.dox" | ||
EXAMPLE_PATH = "@TOP_SRCDIR@/examples" | ||
USE_MDFILE_AS_MAINPAGE = "@TOP_SRCDIR@/README.md" | ||
MACRO_EXPANSION = YES | ||
EXPAND_ONLY_PREDEF = YES | ||
INCLUDE_PATH = "@ZYCORE_INCLUDE_PATH@" | ||
PREDEFINED = @PREDEFINED@ | ||
EXPAND_AS_DEFINED = ZYAN_BITFIELD | ||
DOT_COMMON_ATTR = "fontname=\"sans-serif\",fontsize=10" | ||
DOT_EDGE_ATTR = "labelfontname=\"sans-serif\",labelfontsize=10" | ||
DOT_IMAGE_FORMAT = svg | ||
INTERACTIVE_SVG = YES | ||
HAVE_DOT = @HAVE_DOT@ | ||
DOT_MULTI_TARGETS = @HAVE_DOT_1_8_10@ | ||
DOT_PATH = "@DOT_PATH@" | ||
HTML_FORMULA_FORMAT = @HTML_FORMULA_FORMAT@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule zycore
updated
8 files
+112 −19 | .github/workflows/main.yml | |
+31 −0 | Doxyfile.in | |
+11 −0 | examples/meson.build | |
+220 −0 | meson.build | |
+25 −0 | meson_options.txt | |
+1 −1 | resources/VersionInfo.rc | |
+16 −0 | subprojects/gtest.wrap | |
+38 −0 | tests/meson.build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[wrap-git] | ||
# This is a fallback for plain clone (no submodules available). | ||
url = https://github.com/zyantific/zycore-c.git | ||
# Sync revision to `git submodule status zycore`. | ||
# If doing a release for Zydis, sync both to a tagged commit. | ||
revision = 38d4f0285e6157ee840ea82a9b90aba71c8a705d | ||
depth = 1 | ||
|
||
[provide] | ||
dependency_names = zycore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
examples_req = examples.enabled() | ||
|
||
if examples_req | ||
if decoder.enabled() and formatter.enabled() | ||
executable('DisassembleSimple', 'DisassembleSimple.c', dependencies: [zydis_dep]) | ||
executable('Disassemble', 'Disassemble.c', dependencies: [zydis_dep]) | ||
executable('Formatter01', 'Formatter01.c', dependencies: [zydis_dep]) | ||
executable('Formatter02', 'Formatter02.c', dependencies: [zydis_dep]) | ||
executable('Formatter03', 'Formatter03.c', dependencies: [zydis_dep]) | ||
executable( | ||
'ZydisPerfTest', | ||
'ZydisPerfTest.c', | ||
c_args: host_machine.system() in ['linux', 'freebsd'] ? ['-D_GNU_SOURCE'] : [], | ||
dependencies: [zydis_dep], | ||
) | ||
endif | ||
|
||
if encoder.enabled() | ||
executable('EncodeMov', 'EncodeMov.c', dependencies: [zydis_dep]) | ||
executable('EncodeFromScratch', 'EncodeFromScratch.c', dependencies: [zydis_dep]) | ||
executable('RewriteCode', 'RewriteCode.c', dependencies: [zydis_dep]) | ||
endif | ||
endif | ||
|
||
summary( | ||
{'examples': examples_req}, | ||
section: 'Features', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
ronn_exe = find_program('ronn', required: man) | ||
man_req = ronn_exe.found() | ||
|
||
if man_req | ||
man_names = [ | ||
'ZydisDisasm.1', | ||
'ZydisInfo.1', | ||
] | ||
|
||
foreach page : man_names | ||
custom_target( | ||
page, | ||
input: files(f'@[email protected]'), | ||
command: [ronn_exe, '--roff', '--output-dir', '@OUTDIR@', '@INPUT@'], | ||
output: page, | ||
install: true, | ||
install_dir: datadir / 'man' / 'man1', | ||
) | ||
endforeach | ||
endif | ||
|
||
summary( | ||
{'man': man_req}, | ||
section: 'Features', | ||
) |
Oops, something went wrong.