tomlplusplus/meson.build

188 lines
4.7 KiB
Meson
Raw Normal View History

new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
project(
'tomlplusplus',
'cpp',
version : '2.0.1',
new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
license : 'MIT',
default_options : [
'cpp_std=c++17',
'warning_level=3',
'werror=true',
'cpp_eh=default',
'b_ndebug=if-release'
new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
]
)
tomlplusplus_dep = declare_dependency(
include_directories : include_directories('include'),
version : meson.project_version(),
)
build_tests = get_option('BUILD_TESTS').enabled() or (get_option('BUILD_TESTS').auto() and not meson.is_subproject())
build_examples = get_option('BUILD_EXAMPLES').enabled() or (get_option('BUILD_EXAMPLES').auto() and not meson.is_subproject())
if build_tests or build_examples
compiler = meson.get_compiler('cpp')
message(['compiler ID: ', compiler.get_id()])
message(['compiler version: ', compiler.version()])
# GCC or Clang
if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang'
add_project_arguments([
'-march=native',
'-fno-rtti',
],
language : 'cpp'
)
if get_option('SMALL_BINARIES')
add_project_arguments([ '-fdata-sections', '-ffunction-sections', '-Wl,--gc-sections', '-Wl,-s' ], language : 'cpp')
endif
endif
# GCC
if compiler.get_id() == 'gcc'
add_project_arguments([
'-fmax-errors=5',
'-Wno-init-list-lifetime'
],
language : 'cpp'
)
if get_option('ALL_WARNINGS')
add_project_arguments([
'-Wcast-align',
'-Wcast-qual',
'-Wctor-dtor-privacy',
'-Wdisabled-optimization',
'-Wextra',
'-Wfloat-equal',
'-Wimport',
'-Winit-self',
'-Wlogical-op',
'-Wmissing-declarations',
'-Wmissing-field-initializers',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wnoexcept',
'-Wold-style-cast',
'-Woverloaded-virtual',
'-Wpacked',
'-Wpadded',
'-Wpedantic',
'-Wpointer-arith',
'-Wredundant-decls',
'-Wshadow',
'-Wsign-conversion',
'-Wsign-promo',
'-Wstack-protector',
'-Wstrict-null-sentinel',
'-Wswitch-default',
'-Wswitch-enum',
'-Wundef',
'-Wunreachable-code',
'-Wunused',
'-Wunused-parameter',
'-Wvariadic-macros',
'-Wwrite-strings',
'-Wmissing-noreturn',
'-Wsuggest-attribute=const',
'-Wsuggest-attribute=pure'
],
language : 'cpp'
)
endif
if get_option('SMALL_BINARIES')
add_project_arguments([ '-fmerge-constants' ], language : 'cpp')
endif
endif
# Clang
if compiler.get_id() == 'clang'
if get_option('ALL_WARNINGS')
add_project_arguments([ '-Weverything' ], language : 'cpp')
endif
add_project_arguments([
'-ferror-limit=5',
'-Wno-unused-command-line-argument',
# flags from here down are disabling stupidly pedantic warnings that only appear with -Weverything
'-Wno-c++98-compat',
'-Wno-c++98-compat-pedantic',
'-Wno-documentation',
'-Wno-documentation-unknown-command',
'-Wno-switch-enum',
'-Wno-covered-switch-default'
],
language : 'cpp'
)
if get_option('TIME_TRACE')
add_project_arguments([ '-ftime-trace' ], language : 'cpp')
endif
if get_option('SMALL_BINARIES')
add_project_arguments([ '-Oz', '-fmerge-all-constants', '-Wl,--build-id' ], language : 'cpp')
endif
endif
# ICC's visual studio frontend, ICL
if compiler.get_id() == 'intel-cl'
add_project_arguments([
'/Qoption,cpp,--unicode_source_kind,UTF-8',
'/std=c++latest',
'/wd82', # storage class is not first
'/wd280', # selector expression is constant (why the fuck is that a warning?)
'/wd411', # class provides no constructor (duh, it's an aggregate)
'/wd1011', # missing return statement (false negative)
'/wd1628', # function marked [[noreturn]] returns (false positive)
'/wd3280' # declaration hides member (triggered in Catch2)
],
language : 'cpp'
)
endif
inc = include_directories('include', 'extern')
if build_tests
subdir('tests')
else
message('Not building tests')
endif
if build_examples
subdir('examples')
else
message('Not building examples')
endif
endif
new file: .circleci/config.yml new file: .editorconfig new file: .gitattributes new file: .gitignore new file: .gitmodules new file: LICENSE new file: README.md new file: examples/example.cpp new file: examples/example.toml new file: examples/meson.build new file: include/toml++/toml.h new file: include/toml++/toml_array.h new file: include/toml++/toml_common.h new file: include/toml++/toml_formatter.h new file: include/toml++/toml_node.h new file: include/toml++/toml_node_view.h new file: include/toml++/toml_parser.h new file: include/toml++/toml_table.h new file: include/toml++/toml_utf8.h new file: include/toml++/toml_utf8_generated.h new file: include/toml++/toml_value.h new file: meson.build new file: python/ci_single_header_check.py new file: python/generate_single_header.py new file: python/generate_unicode_functions.py new file: tests/catch2 new file: tests/catch2.h new file: tests/lifetimes.cpp new file: tests/main.cpp new file: tests/meson.build new file: tests/parsing_arrays.cpp new file: tests/parsing_booleans.cpp new file: tests/parsing_comments.cpp new file: tests/parsing_dates_and_times.cpp new file: tests/parsing_floats.cpp new file: tests/parsing_integers.cpp new file: tests/parsing_key_value_pairs.cpp new file: tests/parsing_spec_example.cpp new file: tests/parsing_strings.cpp new file: tests/parsing_tables.cpp new file: tests/tests.cpp new file: tests/tests.h new file: toml.hpp new file: vs/.runsettings new file: vs/example.vcxproj new file: vs/test_char.vcxproj new file: vs/test_char8.vcxproj new file: vs/test_char8_noexcept.vcxproj new file: vs/test_char_noexcept.vcxproj new file: vs/test_strict_char.vcxproj new file: vs/test_strict_char8.vcxproj new file: vs/test_strict_char8_noexcept.vcxproj new file: vs/test_strict_char_noexcept.vcxproj new file: vs/toml++.natvis new file: vs/toml++.props new file: vs/toml++.sln new file: vs/toml++.vcxproj new file: vs/toml++.vcxproj.filters
2020-01-04 14:21:38 +00:00
install_subdir('include/toml++/',
strip_directory: true,
install_dir: 'include/toml++'
)
pkgc = import('pkgconfig')
pkgc.generate (
name: meson.project_name(),
version: meson.project_version(),
description: 'Header-only TOML config file parser and serializer for modern C++'
)
# meson cmake stuff requires at least 0.50
if meson.version().version_compare('>= 0.50')
if get_option('GENERATE_CMAKE_CONFIG').enabled() or (get_option('GENERATE_CMAKE_CONFIG').auto() and not meson.is_subproject())
cmake = import('cmake')
cmake.write_basic_package_version_file(
name: meson.project_name(),
version: meson.project_version()
)
cmake_conf = configuration_data()
cmake.configure_package_config_file(
name: meson.project_name(),
input: 'cmake/tomlplusplus.cmake.in',
configuration: cmake_conf,
)
endif
endif