-
Notifications
You must be signed in to change notification settings - Fork 362
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This is follow up work to my previous series. I've tried to make the Meson build mirror the CMake build more closely. I've also made an attempt at adding some instructions to the documents on using Meson. --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <henryschreineriii@gmail.com>
- Loading branch information
1 parent
1a1d9d4
commit 6d83f45
Showing
7 changed files
with
127 additions
and
11 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
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
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
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 +1,3 @@ | ||
option('tests', type: 'boolean', value: false, description: 'Build CLI11 tests') | ||
option('single-file-header', type: 'boolean', value: false, description : 'Generate a single header file.') | ||
option('precompiled', type: 'boolean', value: false, description : 'Generate a precompiled static library instead of a header-only') |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Because Meson does not allow outputs to be placed in subfolders, we must have | ||
# meson.build here when generating the single file header so that it is placced | ||
# in the correct location. | ||
|
||
prog_python = find_program('python') | ||
|
||
single_main_file = files('CLI11.hpp.in') | ||
|
||
if use_single_header | ||
single_header = custom_target( | ||
'CLI11.hpp', | ||
input: [files('../scripts/MakeSingleHeader.py'), cli11_headers, cli11_impl_headers], | ||
output: 'CLI11.hpp', | ||
command : [prog_python, '@INPUT@', '--main', single_main_file, '--output', '@OUTPUT@'], | ||
depend_files: [single_main_file], | ||
) | ||
else | ||
# the `declare_dependency` needs to have the single_header source as a source | ||
# dependency, to ensure that the generator runs before any attempts to include | ||
# the header happen. Adding an empty list is an idiomatic way to ensure the | ||
# variable exists but does nothing | ||
single_header = [] | ||
endif |
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
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,5 @@ | ||
project('mesonTest', ['c', 'cpp'], default_options: ['cpp_std=c++11']) | ||
project('mesonTest', ['cpp'], default_options: ['cpp_std=c++11']) | ||
|
||
cli11_dep = subproject('CLI11').get_variable('CLI11_dep') | ||
cli11_dep = dependency('CLI11') | ||
|
||
mainExe = executable('main', ['main.cpp'], dependencies: [cli11_dep]) |