Skip to content

Commit

Permalink
mk: sample Meson subproject Wrap file
Browse files Browse the repository at this point in the history
  • Loading branch information
yoursunny committed Feb 26, 2022
1 parent 135f329 commit 22e7035
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,5 @@ For Linux,
5. Install headers to system: `sudo ninja install`
6. Add `#include <NDNph-config.h>` and `#include <NDNph.h>` in your project, and start coding.
7. Check out the [example programs](programs/) for how to use.

To use as a Meson subproject, copy and modify the [sample Wrap file](docs/NDNph.wrap).
6 changes: 6 additions & 0 deletions docs/NDNph.wrap
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[wrap-git]
url = https://github.com/yoursunny/NDNph.git
revision = INSERT-COMMIT-HASH

[provide]
NDNph = ndnph_dep
4 changes: 3 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ project('NDNph', 'cpp',
'cpp_std=c++11',
'cpp_eh=none',
'cpp_rtti=false'
])
],
meson_version: '>=0.61.0'
)

subdir('src')

Expand Down
2 changes: 1 addition & 1 deletion mk/update-list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ export LC_ALL=C

(
cd programs
find -name '*.cpp' -printf '%P\n' | sort | sed "s|\(.*\)\.cpp|executable('ndnph-\1', '\1.cpp', dependencies: [lib_dep])|"
find -name '*.cpp' -printf '%P\n' | sort | sed "s|\(.*\)\.cpp|executable('ndnph-\1', '\1.cpp', dependencies: [ndnph_dep])|"
) > programs/meson.build
6 changes: 3 additions & 3 deletions programs/meson.build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
executable('ndnph-keychain', 'keychain.cpp', dependencies: [lib_dep])
executable('ndnph-ndncertclient', 'ndncertclient.cpp', dependencies: [lib_dep])
executable('ndnph-pingclient', 'pingclient.cpp', dependencies: [lib_dep])
executable('ndnph-keychain', 'keychain.cpp', dependencies: [ndnph_dep])
executable('ndnph-ndncertclient', 'ndncertclient.cpp', dependencies: [ndnph_dep])
executable('ndnph-pingclient', 'pingclient.cpp', dependencies: [ndnph_dep])
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ endif
has_all_linux_deps = boost.found() and mbedcrypto.found() and have_urandom and have_socket_h

config_h = configure_file(output: 'NDNph-config.h', configuration: conf)
lib_dep = declare_dependency(
ndnph_dep = declare_dependency(
include_directories: include_directories('.'),
compile_args: ['-include', 'NDNph-config.h'],
dependencies: [boost, mbedcrypto, libmemif])
Expand Down
2 changes: 1 addition & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ gtest = dependency('gtest_main')
subdir('unit')
unittest_exe = executable('unittest',
unittest_files,
dependencies: [lib_dep, gmock, gtest],
dependencies: [ndnph_dep, gmock, gtest],
include_directories: ['.'],
)
test('unittest', unittest_exe)

0 comments on commit 22e7035

Please sign in to comment.