Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions examples/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
SimpleTest = executable('SimpleTest','SimpleTest.cpp',
link_with: mylib)
# Build simple executable
SimpleTest = executable(
'SimpleTest',
'SimpleTest.cpp',
link_with: libbyteconvert
)

# Specify test for library
test('SimpleTest',SimpleTest)
18 changes: 13 additions & 5 deletions libbyteconvert/meson.build
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
mylib = shared_library('byteconvert', 'ByteConvert.cpp',
version : meson.project_version(),
soversion : '0',
install: true)
install_headers('ByteConvert.hpp', subdir : 'ByteConvert')
# Install headers
install_headers('ByteConvert.hpp', subdir : 'ByteConvert')

# List sources
src = ['ByteConvert.cpp']

# Link & build libraries
libbyteconvert = library(
meson.project_name(),
src,
version : meson.project_version(),
install: true
)
34 changes: 21 additions & 13 deletions meson.build
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
project('libbyteconvert','cpp',
version:'0.1.4',
default_options : [
'c_std=c11',
'cpp_std=c++11'])
# Project info
project('byteconvert', 'cpp', version:'1.0.0', license: 'MIT', default_options : ['cpp_std=c++11'])

# Import modules
pkg = import('pkgconfig')

subdir('libbyteconvert')
subdir('libbyteconvert') # Run meson script in libbyteconvert dir
subdir('examples') # Run meson script in examples dir

pkg.generate(libraries : mylib,
version : meson.project_version(),
name : 'libbyteconvert',
filebase : 'byteconvert',
description : 'A conversion library.',
url: 'https://github.com/SloCompTech/ByteConvert_cpp')
# Package info
pkg.generate(
name : 'lib' + meson.project_name(),
description : 'Library for converting variables to bytes.',
version : meson.project_version(),
filebase : meson.project_name(),
url: 'https://github.com/SloCompTech/ByteConvert_cpp',
libraries : libbyteconvert
)

subdir('examples')
# Declare as dependency so it can be used elsewhere
libbyteconvert_inc = include_directories('libbyteconvert')
libbyteconvert_dep = declare_dependency(
link_with: libbyteconvert,
include_directories: libbyteconvert_inc
)