abacus: bootstrap build system

This commit is contained in:
Bruno BELANYI 2021-08-19 21:32:33 +02:00
commit 5b57981af7
6 changed files with 57 additions and 0 deletions

13
meson.build Normal file
View file

@ -0,0 +1,13 @@
project(
'abacus',
'cpp',
version: '0.0.0',
license: 'MIT',
default_options: [
'warning_level=3',
'cpp_std=c++17',
],
)
subdir('src')
subdir('tests')

5
src/abacus.cc Normal file
View file

@ -0,0 +1,5 @@
#include <iostream>
int main() {
std::cout << "Hello World!\n";
}

8
src/meson.build Normal file
View file

@ -0,0 +1,8 @@
abacus_sources = files(
'abacus.cc',
)
abacus = executable(
'abacus',
sources: abacus_sources,
)

1
tests/meson.build Normal file
View file

@ -0,0 +1 @@
subdir('unit')

5
tests/unit/base.cc Normal file
View file

@ -0,0 +1,5 @@
#include <gtest/gtest.h>
TEST(misc, passing) {
ASSERT_EQ(1, 1);
}

25
tests/unit/meson.build Normal file
View file

@ -0,0 +1,25 @@
gtest = dependency(
'gtest',
main: true,
required: false,
)
if gtest.found()
unit_test_sources = files(
'base.cc',
)
unit_tests = executable(
'unit_tests',
sources: unit_test_sources,
dependencies: [
gtest,
],
)
test(
'unit tests',
unit_tests,
protocol: 'gtest',
)
endif