-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from SloCompTech/develop
Improved meson script
- Loading branch information
Showing
3 changed files
with
42 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) |