Skip to content

Commit

Permalink
use meson for some portability (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
epsilon-0 authored Sep 4, 2024
1 parent fc2ab55 commit 32830e7
Show file tree
Hide file tree
Showing 11 changed files with 907 additions and 381 deletions.
23 changes: 18 additions & 5 deletions .github/workflows/c-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,25 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
branches: '*'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v2
- name: make check
run: make check
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install meson ninja
- name: Configure Project
run: meson setup builddir
- name: Run Tests
run: meson test -C builddir -v
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
# tests
ibuf_test
imsg_sendrcv

# libraries
libimsg.so.*

# vscode
.vscode

# pkgconfig files
libimsg.pc

Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ MANDIR = ${PREFIX}/share/man
SRCS = src/imsg.c src/imsg-buffer.c
OBJS = ${SRCS:.c=.o}

TESTSRCS = test/imsg_sendrcv.c
TESTSRCS = imsg_sendrcv ibuf_test
TESTOBJS = ${TESTSRCS:.c=.test}

all: ${LIBRARY} ${STATICLIB} libimsg.pc
Expand Down Expand Up @@ -52,7 +52,7 @@ check: test
test: all ${TESTOBJS}

${TESTOBJS}: ${TESTSRCS}
${CC} ${CFLAGS} -Isrc ${TESTSRCS} ${STATICLIB} -o $@
${CC} ${CFLAGS} -Isrc test/$@.c ${STATICLIB} -o $@
./$@

clean:
Expand Down
Loading

0 comments on commit 32830e7

Please sign in to comment.