|
| 1 | +project( |
| 2 | + 'pystring', |
| 3 | + 'cpp', |
| 4 | + version: '1.1.4', |
| 5 | + license: 'BSD-3-Clause', |
| 6 | + license_files: 'LICENSE', |
| 7 | + meson_version: '>=1.3', |
| 8 | + default_options: ['cpp_std=c++11', 'warning_level=3'], |
| 9 | +) |
| 10 | + |
| 11 | +inc = include_directories('.') |
| 12 | + |
| 13 | +srcs = files('pystring.cpp') |
| 14 | +hdrs = files('pystring.h') |
| 15 | + |
| 16 | +pystring_lib = library( |
| 17 | + 'pystring', |
| 18 | + srcs, |
| 19 | + implicit_include_directories: false, |
| 20 | + include_directories: inc, |
| 21 | + version: meson.project_version(), |
| 22 | + install: true, |
| 23 | +) |
| 24 | +pystring_dep = declare_dependency( |
| 25 | + link_with: pystring_lib, |
| 26 | + include_directories: inc, |
| 27 | +) |
| 28 | +meson.override_dependency('pystring', pystring_dep) |
| 29 | + |
| 30 | +test( |
| 31 | + 'PyStringTest', |
| 32 | + executable( |
| 33 | + 'pystring_test', |
| 34 | + 'test.cpp', |
| 35 | + dependencies: pystring_dep, |
| 36 | + build_by_default: false, |
| 37 | + ), |
| 38 | +) |
| 39 | + |
| 40 | +install_headers(hdrs) |
| 41 | + |
| 42 | +pkgconfig = import('pkgconfig') |
| 43 | +pkgconfig.generate( |
| 44 | + pystring_lib, |
| 45 | + description: 'C++ functions matching the interface and behavior of python string methods with std::string', |
| 46 | +) |
| 47 | +cmake = import('cmake') |
| 48 | +cmake.write_basic_package_version_file( |
| 49 | + name: 'pystring', |
| 50 | + version: meson.project_version(), |
| 51 | +) |
0 commit comments