Skip to content

Commit e17d0fa

Browse files
committed
Switch to meson
1 parent 363c7f8 commit e17d0fa

File tree

3 files changed

+24
-57
lines changed

3 files changed

+24
-57
lines changed

CMakeLists.txt

Lines changed: 0 additions & 39 deletions
This file was deleted.

Makefile

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,13 @@
1-
NUM_JOBS=2
2-
GENERATOR=Ninja
31
BUILD_DIR=build/
4-
BUILD_TYPE=Debug
5-
6-
# These Flags are passed to Cmake When Generating Build Files
7-
CMAKE_GEN_FLAGS=
8-
9-
# These Flags are passed to Cmake When Building The Project
10-
CMAKE_BUILD_FLAGS=
11-
12-
ifeq ($(OS),Windows_NT)
13-
GENERATOR=Visual Studio 17 2022
14-
CMAKE_GEN_FLAGS=-T "ClangCL"
15-
endif
2+
# Possible Options: debug, debugoptimized, minsize, plain, release
3+
BUILD_TYPE=debug
164

175
all:
18-
@cmake -L -S ./ -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(BUILD_TYPE) -G "$(GENERATOR)" $(CMAKE_GEN_FLAGS)
19-
@cmake --build $(BUILD_DIR) --config=$(BUILD_TYPE) --parallel $(NUM_JOBS) $(CMAKE_BUILD_FLAGS)
6+
@meson setup $(BUILD_DIR) ./ --buildtype=$(BUILD_TYPE)
7+
@meson compile -C $(BUILD_DIR)
8+
9+
test: all
10+
@meson test -C $(BUILD_DIR)
2011

2112
clean:
2213
@$(RM) -r $(BUILD_DIR)
23-
24-

meson.build

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
project('filesystem', 'cpp')
2+
3+
FileSystem_IncludeDirs = include_directories('include/')
4+
FileSystem_Static = static_library(
5+
'filesystem',
6+
['src/fs.cpp', 'src/file.cpp', 'src/helper.cpp'],
7+
include_directories : FileSystem_IncludeDirs,
8+
)
9+
10+
_TestFileSystem = executable('_TestFileSystem', 'test/test.cpp',
11+
include_directories : [include_directories('test/'), FileSystem_IncludeDirs],
12+
link_with : FileSystem_Static,
13+
dependencies : meson.get_compiler('cpp').find_library('rt')
14+
)
15+
16+
test('_TestFileSystem', _TestFileSystem, workdir : meson.source_root(), env : environment({'MALLOC_PERTURB_': '0'}))
17+

0 commit comments

Comments
 (0)