From 3474ead1c01e2565c4e9625a6889cbca0c0d4563 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Sun, 19 Dec 2021 15:41:05 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20hot=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- subprojects/packagefiles/spdlog/LICENSE.build | 19 ++++++++++++ subprojects/packagefiles/spdlog/meson.build | 29 +++++++++++++++++++ .../packagefiles/spdlog/meson_options.txt | 4 +++ .../packagefiles/spdlog/src/meson.build | 17 +++++++++++ .../packagefiles/spdlog/tests/meson.build | 25 ++++++++++++++++ subprojects/spdlog.wrap | 13 ++++----- 7 files changed, 100 insertions(+), 9 deletions(-) create mode 100644 subprojects/packagefiles/spdlog/LICENSE.build create mode 100644 subprojects/packagefiles/spdlog/meson.build create mode 100644 subprojects/packagefiles/spdlog/meson_options.txt create mode 100644 subprojects/packagefiles/spdlog/src/meson.build create mode 100644 subprojects/packagefiles/spdlog/tests/meson.build diff --git a/.gitignore b/.gitignore index 99e4d04..3b912b5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,7 +10,7 @@ subprojects/cpr subprojects/fmt subprojects/ftxui subprojects/nlohmann_json-* -subprojects/spdlog-* +subprojects/spdlog subprojects/packagecache # Prerequisites diff --git a/subprojects/packagefiles/spdlog/LICENSE.build b/subprojects/packagefiles/spdlog/LICENSE.build new file mode 100644 index 0000000..b59833d --- /dev/null +++ b/subprojects/packagefiles/spdlog/LICENSE.build @@ -0,0 +1,19 @@ +Copyright (c) 2021 The Meson development team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/subprojects/packagefiles/spdlog/meson.build b/subprojects/packagefiles/spdlog/meson.build new file mode 100644 index 0000000..02c30b2 --- /dev/null +++ b/subprojects/packagefiles/spdlog/meson.build @@ -0,0 +1,29 @@ +project('spdlog', 'cpp', version : '1.9.2', license: 'MIT', + default_options : ['cpp_std=c++11']) + +inc = include_directories('include') + +thread_dep = dependency('threads') + +spdlog_dependencies = [thread_dep] +spdlog_compile_args = [] + + +if get_option('external_fmt') + fmt_dep = dependency('fmt') + spdlog_dependencies += fmt_dep + spdlog_compile_args += '-DSPDLOG_FMT_EXTERNAL' +endif + +if get_option('compile_library') + spdlog_compile_args += '-DSPDLOG_COMPILED_LIB' + subdir('src') + + spdlog_dep = declare_dependency(include_directories : inc, dependencies : spdlog_dependencies, link_with : spdlog_lib, compile_args : spdlog_compile_args) +else + spdlog_dep = declare_dependency(include_directories : inc, dependencies : spdlog_dependencies, compile_args : spdlog_compile_args) +endif + +if get_option('tests') + subdir('tests') +endif diff --git a/subprojects/packagefiles/spdlog/meson_options.txt b/subprojects/packagefiles/spdlog/meson_options.txt new file mode 100644 index 0000000..ca6d6ff --- /dev/null +++ b/subprojects/packagefiles/spdlog/meson_options.txt @@ -0,0 +1,4 @@ +option('tests', type: 'boolean', value: false, description: 'Build the unit tests') + +option('compile_library', type: 'boolean', value: false, description: 'Builds a static/shared lib for faster compile times') +option('external_fmt', type: 'boolean', value: false, description: 'Builds with external fmt lib instead of internal') diff --git a/subprojects/packagefiles/spdlog/src/meson.build b/subprojects/packagefiles/spdlog/src/meson.build new file mode 100644 index 0000000..3c10cd1 --- /dev/null +++ b/subprojects/packagefiles/spdlog/src/meson.build @@ -0,0 +1,17 @@ +src = [ + 'spdlog.cpp', + 'stdout_sinks.cpp', + 'color_sinks.cpp', + 'file_sinks.cpp', + 'async.cpp', + 'cfg.cpp' +] + +fmt = 'fmt.cpp' + + +if not(get_option('external_fmt')) +src += fmt +endif + +spdlog_lib = library('spdlog', src, include_directories : inc, dependencies : spdlog_dependencies, cpp_args : spdlog_compile_args) diff --git a/subprojects/packagefiles/spdlog/tests/meson.build b/subprojects/packagefiles/spdlog/tests/meson.build new file mode 100644 index 0000000..cd78374 --- /dev/null +++ b/subprojects/packagefiles/spdlog/tests/meson.build @@ -0,0 +1,25 @@ +test_src = [ + 'test_file_helper.cpp', + 'test_file_logging.cpp', + 'test_daily_logger.cpp', + 'test_misc.cpp', + 'test_eventlog.cpp', + 'test_pattern_formatter.cpp', + 'test_async.cpp', + 'test_registry.cpp', + 'test_macros.cpp', + 'utils.cpp', + 'main.cpp', + 'test_mpmc_q.cpp', + 'test_dup_filter.cpp', + 'test_fmt_helper.cpp', + 'test_stdout_api.cpp', + 'test_backtrace.cpp', + 'test_create_dir.cpp', + 'test_cfg.cpp', + 'test_time_point.cpp', + 'test_stopwatch.cpp' +] + +tests_exe = executable('tests_exe', test_src, dependencies : [spdlog_dep]) +test('tests', tests_exe) diff --git a/subprojects/spdlog.wrap b/subprojects/spdlog.wrap index bd0a67b..47607ea 100644 --- a/subprojects/spdlog.wrap +++ b/subprojects/spdlog.wrap @@ -1,11 +1,8 @@ -[wrap-file] -directory = spdlog-1.9.2 -source_url = https://github.com/gabime/spdlog/archive/v1.9.2.tar.gz -source_filename = v1.9.2.tar.gz -source_hash = 6fff9215f5cb81760be4cc16d033526d1080427d236e86d70bb02994f85e3d38 -patch_filename = spdlog_1.9.2-1_patch.zip -patch_url = https://wrapdb.mesonbuild.com/v2/spdlog_1.9.2-1/get_patch -patch_hash = 77182bd65366818ef61fd5bd1745fedd4a6d4aeefc03f34a1ddb05ef9c944c95 +[wrap-git] +url = https://github.com/vnepogodin/spdlog.git +revision = patch-1 + +patch_directory = spdlog [provide] spdlog = spdlog_dep