abacus: bootstrap build system
This commit is contained in:
commit
5b57981af7
13
meson.build
Normal file
13
meson.build
Normal 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
5
src/abacus.cc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World!\n";
|
||||
}
|
8
src/meson.build
Normal file
8
src/meson.build
Normal file
|
@ -0,0 +1,8 @@
|
|||
abacus_sources = files(
|
||||
'abacus.cc',
|
||||
)
|
||||
|
||||
abacus = executable(
|
||||
'abacus',
|
||||
sources: abacus_sources,
|
||||
)
|
1
tests/meson.build
Normal file
1
tests/meson.build
Normal file
|
@ -0,0 +1 @@
|
|||
subdir('unit')
|
5
tests/unit/base.cc
Normal file
5
tests/unit/base.cc
Normal file
|
@ -0,0 +1,5 @@
|
|||
#include <gtest/gtest.h>
|
||||
|
||||
TEST(misc, passing) {
|
||||
ASSERT_EQ(1, 1);
|
||||
}
|
25
tests/unit/meson.build
Normal file
25
tests/unit/meson.build
Normal 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
|
Loading…
Reference in a new issue