🎉 create cpp project.
parent
6d32245dd9
commit
15b2f612ac
|
@ -0,0 +1,4 @@
|
|||
*~*
|
||||
*\#*
|
||||
.cache
|
||||
build
|
|
@ -0,0 +1,20 @@
|
|||
.PHONY: build tests
|
||||
|
||||
build:
|
||||
meson setup build
|
||||
meson compile -C build
|
||||
|
||||
tests: build
|
||||
build/snake-tests
|
||||
|
||||
install: tests force-install
|
||||
|
||||
force-install:
|
||||
meson install -C build
|
||||
|
||||
check:
|
||||
cppcheck --enable=all -q \
|
||||
--language=c++ \
|
||||
--suppress=missingIncludeSystem \
|
||||
--suppress=missingInclude \
|
||||
src tests
|
44
README.md
44
README.md
|
@ -1,3 +1,43 @@
|
|||
# snake
|
||||
# Snake Build System
|
||||
Yet another language agnostic build system.
|
||||
|
||||
Snake build system
|
||||
## Usage
|
||||
None for now, but maybe one day...
|
||||
|
||||
## How to install
|
||||
Snake relies on some libraries you must install in order to compile it.
|
||||
|
||||
- catch2 (for testing)
|
||||
|
||||
First, you need to compile Snake using the given Makefile:
|
||||
|
||||
```bash
|
||||
make
|
||||
```
|
||||
|
||||
Before installing, you can run the tests using the following commands:
|
||||
|
||||
To run the test suite:
|
||||
```bash
|
||||
make test
|
||||
```
|
||||
|
||||
To run static tests:
|
||||
|
||||
```bash
|
||||
make check
|
||||
```
|
||||
|
||||
Then you can install Snake this way:
|
||||
|
||||
```bash
|
||||
sudo make install
|
||||
```
|
||||
|
||||
## How to contribute
|
||||
Don't.
|
||||
|
||||
## License
|
||||
Snake is released under the GPLv3.
|
||||
|
||||
See the LICENSE file at the project's root for more information.
|
|
@ -0,0 +1,43 @@
|
|||
project('snake',
|
||||
'cpp',
|
||||
version: '0.0.0',
|
||||
default_options: [
|
||||
'prefix=/usr',
|
||||
'warning_level=3',
|
||||
'cpp_std=c++17'
|
||||
])
|
||||
|
||||
conf = configuration_data()
|
||||
conf.set('version', meson.project_version())
|
||||
|
||||
configure_file(input: 'src/snake.in.hpp',
|
||||
output: 'snake.hpp',
|
||||
configuration: conf)
|
||||
|
||||
snake_lib = static_library('snake',
|
||||
sources: [
|
||||
],
|
||||
dependencies: [
|
||||
])
|
||||
|
||||
snake_dep = declare_dependency(link_with: [
|
||||
snake_lib
|
||||
])
|
||||
|
||||
executable('snake',
|
||||
sources: [
|
||||
'src/main.cpp',
|
||||
],
|
||||
dependencies: [
|
||||
snake_dep
|
||||
],
|
||||
install: true)
|
||||
|
||||
executable('snake-tests',
|
||||
sources: [
|
||||
'tests/main.cpp',
|
||||
],
|
||||
dependencies: [
|
||||
snake_dep,
|
||||
dependency('catch2')
|
||||
])
|
|
@ -0,0 +1,8 @@
|
|||
#include <iostream>
|
||||
#include "snake.hpp"
|
||||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::cout << "snake v" << SNAKE_VERSION << std::endl;
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
#ifndef sn_SNAKE_IN_HPP
|
||||
#define sn_SNAKE_IN_HPP
|
||||
|
||||
#define SNAKE_VERSION std::string("@version@")
|
||||
|
||||
#endif
|
|
@ -0,0 +1,2 @@
|
|||
#define CATCH_CONFIG_MAIN
|
||||
#include <catch2/catch.hpp>
|
Loading…
Reference in New Issue