This commit is contained in:
@@ -0,0 +1,34 @@
|
|||||||
|
name: Meson Build and Deploy
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: ["lisp"]
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: home-1
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install -y meson ninja-build gcc
|
||||||
|
|
||||||
|
- name: Configure Meson
|
||||||
|
run: meson setup build
|
||||||
|
|
||||||
|
- name: Build project
|
||||||
|
run: meson compile -C build
|
||||||
|
|
||||||
|
- name: Run tests
|
||||||
|
run: meson test -C build --print-errorlogs || true
|
||||||
|
|
||||||
|
- name: Upload artifact
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: beluga
|
||||||
|
path: build/
|
||||||
+5
-4
@@ -2,12 +2,12 @@ project('editor', 'c',
|
|||||||
version : '1.0.0',
|
version : '1.0.0',
|
||||||
default_options : [
|
default_options : [
|
||||||
'warning_level=2',
|
'warning_level=2',
|
||||||
'c_std=c99'
|
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
# Check if we're using Clang and add Clang-specific options
|
# Check if we're using Clang and add Clang-specific options
|
||||||
cc = meson.get_compiler('c')
|
cc = meson.get_compiler('c')
|
||||||
|
m = cc.find_library('m', required: true)
|
||||||
if cc.get_id() == 'clang'
|
if cc.get_id() == 'clang'
|
||||||
add_project_arguments([
|
add_project_arguments([
|
||||||
'-Wextra',
|
'-Wextra',
|
||||||
@@ -33,7 +33,7 @@ if cc.get_id() == 'clang'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Include directory
|
# Include directory
|
||||||
inc_dir = include_directories('include')
|
inc_dir = include_directories('include', 'lisp-interpreter/dist')
|
||||||
|
|
||||||
# Source files
|
# Source files
|
||||||
src_files = files(
|
src_files = files(
|
||||||
@@ -45,12 +45,13 @@ src_files = files(
|
|||||||
'src/input.c',
|
'src/input.c',
|
||||||
'src/output.c',
|
'src/output.c',
|
||||||
'src/row_op.c',
|
'src/row_op.c',
|
||||||
'src/terminal.c'
|
'src/terminal.c',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Executable
|
# Executable
|
||||||
executable('editor',
|
executable('editor',
|
||||||
src_files,
|
src_files,
|
||||||
include_directories : inc_dir,
|
include_directories : inc_dir,
|
||||||
install : true
|
install : true,
|
||||||
|
dependencies: [m]
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user