Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
spdlog
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
spdlog
Commits
822aee2b
Unverified
Commit
822aee2b
authored
Jun 30, 2019
by
Daniel Mensinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added meson build support
parent
f09334dc
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
0 deletions
+168
-0
.gitignore
.gitignore
+3
-0
meson.build
bench/meson.build
+13
-0
meson.build
meson.build
+105
-0
meson_options.txt
meson_options.txt
+4
-0
meson.build
tests/meson.build
+43
-0
No files found.
.gitignore
View file @
822aee2b
...
...
@@ -34,6 +34,9 @@ build/*
# Codelite
.codelite
# KDevelop
*.kdev4
# .orig files
*.orig
...
...
bench/meson.build
0 → 100644
View file @
822aee2b
benchmark = dependency('benchmark')
bench_matrix = [
['bench', [spdlog_dep], []],
['async_bench', [spdlog_dep], []],
['formatter-bench', [spdlog_dep, benchmark], ['all']],
['latency', [spdlog_dep, benchmark], []],
]
foreach i : bench_matrix
bench_exe = executable(i[0], i[0] + '.cpp', dependencies: i[1])
benchmark('bench_' + i[0], bench_exe, args: i[2])
endforeach
meson.build
0 → 100644
View file @
822aee2b
project('spdlog', ['cpp'],
license : 'MIT',
version : '1.3.1',
default_options : ['warning_level=3', 'cpp_std=c++11', 'default_library=static'],
)
# ------------------------
# --- Dependencies ---
# ------------------------
dep_list = []
compile_args = []
# Threads
dep_list += dependency('threads')
# Check for FMT
if get_option('extrenal_fmt')
if not meson.version().version_compare('>=0.49.0')
warning('Finding fmt can fail wit meson versions before 0.49.0')
endif
dep_list += dependency('fmt')
compile_args += '-DSPDLOG_FMT_EXTERNAL'
endif
# ------------------------------------
# --- Compiled library version ---
# ------------------------------------
spdlog_inc = include_directories('./include')
spdlog = library('spdlog', ['src/spdlog.cpp'],
cpp_args : [compile_args] + ['-DSPDLOG_COMPILED_LIB'],
include_directories : spdlog_inc,
dependencies : dep_list,
install : true,
)
spdlog_dep = declare_dependency(
link_with : spdlog,
include_directories : spdlog_inc,
compile_args : compile_args + ['-DSPDLOG_COMPILED_LIB'],
dependencies : dep_list,
version : meson.project_version(),
)
# ----------------------------------
# --- Header only dependency ---
# ----------------------------------
spdlog_headeronly_dep = declare_dependency(
include_directories : spdlog_inc,
compile_args : compile_args,
dependencies : dep_list,
version : meson.project_version(),
)
# ------------------------
# --- Installation ---
# ------------------------
install_subdir('include/spdlog', install_dir: get_option('includedir'))
pkg = import('pkgconfig')
pkg.generate(spdlog,
name : 'spdlog',
description : 'Fast C++ logging library',
url : 'https://github.com/gabime/spdlog',
extra_cflags : ['-DSPDLOG_COMPILED_LIB']
)
# -------------------------------------
# --- Conditionally add subdirs ---
# -------------------------------------
if get_option('enable_tests')
subdir('tests')
endif
if get_option('enable_examples')
subdir('example')
endif
if get_option('enable_benchmarks')
subdir('bench')
endif
# -------------------
# --- Summary ---
# -------------------
summary_str = '''spdlog build summary:
- using extrenal fmt: @0@
- building tests: @1@
- building examples: @2@
- building benchmarks: @3@
'''.format(
get_option('extrenal_fmt'),
get_option('enable_tests'),
get_option('enable_examples'),
get_option('enable_benchmarks')
)
message(summary_str)
meson_options.txt
0 → 100644
View file @
822aee2b
option('extrenal_fmt', type: 'boolean', value: false)
option('enable_examples', type: 'boolean', value: false)
option('enable_benchmarks', type: 'boolean', value: false)
option('enable_tests', type: 'boolean', value: false)
tests/meson.build
0 → 100644
View file @
822aee2b
test_sources = files([
'main.cpp',
'test_async.cpp',
'test_dup_filter.cpp',
'test_errors.cpp',
'test_file_helper.cpp',
'test_file_logging.cpp',
'test_fmt_helper.cpp',
'test_macros.cpp',
'test_misc.cpp',
'test_mpmc_q.cpp',
'test_pattern_formatter.cpp',
'test_registry.cpp',
'test_stdout_api.cpp',
'utils.cpp',
])
global_test_deps = []
# -----------------------------------------------------
# --- Add the systemd test if libsystemd is found ---
# -----------------------------------------------------
systemd_dep = dependency('libsystemd', required: false)
if systemd_dep.found()
test_sources += files(['test_systemd.cpp'])
global_test_deps += systemd_dep
endif
# --------------------------------------
# --- Build the test executables ---
# --------------------------------------
test_matrix = [
['spdlog-utest', spdlog_dep],
['spdlog-utest-ho', spdlog_headeronly_dep],
]
foreach i : test_matrix
test_exe = executable(i[0], test_sources, dependencies: global_test_deps + [i[1]])
test('test_' + i[0], test_exe)
endforeach
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment