🎉 C meson project.
parent
2da5939d81
commit
e434d5c4ae
|
@ -0,0 +1,4 @@
|
||||||
|
*~*
|
||||||
|
*\#*
|
||||||
|
.cache
|
||||||
|
build
|
|
@ -0,0 +1,19 @@
|
||||||
|
.PHONY: build tests
|
||||||
|
|
||||||
|
build:
|
||||||
|
meson setup build
|
||||||
|
meson compile -C build
|
||||||
|
|
||||||
|
tests: build
|
||||||
|
build/roza-tests
|
||||||
|
|
||||||
|
install: build
|
||||||
|
meson install -C build
|
||||||
|
|
||||||
|
check:
|
||||||
|
@cppcheck --language=c --enable=all lib src -q \
|
||||||
|
--suppress=missingIncludeSystem
|
||||||
|
|
||||||
|
@cppcheck --language=c --enable=all tests/units -q \
|
||||||
|
--suppress=missingIncludeSystem \
|
||||||
|
--suppress=unusedFunction
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef RZ_CONF_IN_H
|
||||||
|
#define RZ_CONF_IN_H
|
||||||
|
|
||||||
|
#define ROZA_VERSION "@version@"
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,43 @@
|
||||||
|
project(
|
||||||
|
'roza',
|
||||||
|
'c',
|
||||||
|
version: '0.0.0'
|
||||||
|
)
|
||||||
|
|
||||||
|
conf = configuration_data()
|
||||||
|
conf.set('version', meson.project_version())
|
||||||
|
|
||||||
|
configure_file(
|
||||||
|
input: 'lib/conf.in.h',
|
||||||
|
output: 'conf.h',
|
||||||
|
configuration: conf
|
||||||
|
)
|
||||||
|
|
||||||
|
roza_lib = static_library(
|
||||||
|
'roza',
|
||||||
|
sources: [
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
roza_dep = declare_dependency(
|
||||||
|
link_with: roza_lib,
|
||||||
|
include_directories: ['lib']
|
||||||
|
)
|
||||||
|
|
||||||
|
executable('roza',
|
||||||
|
sources: [
|
||||||
|
'src/main.c'
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
roza_dep
|
||||||
|
],
|
||||||
|
install: true)
|
||||||
|
|
||||||
|
executable('roza-tests',
|
||||||
|
sources: [
|
||||||
|
'tests/units/trivial.c'
|
||||||
|
],
|
||||||
|
dependencies: [
|
||||||
|
roza_dep,
|
||||||
|
dependency('criterion')
|
||||||
|
])
|
|
@ -0,0 +1,8 @@
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <conf.h>
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
printf("Roza v%s\n", ROZA_VERSION);
|
||||||
|
return 0;
|
||||||
|
}
|
|
@ -0,0 +1,5 @@
|
||||||
|
#include <criterion/criterion.h>
|
||||||
|
|
||||||
|
Test(trivial, trivial) {
|
||||||
|
cr_assert(1 + 1 == 2);
|
||||||
|
}
|
Loading…
Reference in New Issue