mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-22 11:23:29 +01:00
add meson option to not install library
This commit is contained in:
parent
26b9bcde1f
commit
4cd7c0ed18
@ -1 +1,2 @@
|
|||||||
option('tests', type: 'boolean', value: true, description: 'Build the unit tests')
|
option('tests', type: 'boolean', value: true, description: 'Build the unit tests')
|
||||||
|
option('install', type: 'boolean', value: true, description: 'Install the library')
|
||||||
|
@ -16,6 +16,7 @@ configure_file(
|
|||||||
format: 'cmake@',
|
format: 'cmake@',
|
||||||
install_dir: get_option('includedir') / 'catch2',
|
install_dir: get_option('includedir') / 'catch2',
|
||||||
configuration: conf_data,
|
configuration: conf_data,
|
||||||
|
install: get_option('install')
|
||||||
)
|
)
|
||||||
|
|
||||||
fs = import('fs')
|
fs = import('fs')
|
||||||
@ -339,7 +340,9 @@ foreach file : headers
|
|||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
install_headers(file, subdir: join_paths(include_subdir, folder))
|
if get_option('install')
|
||||||
|
install_headers(file, subdir: join_paths(include_subdir, folder))
|
||||||
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
catch2_dependencies = []
|
catch2_dependencies = []
|
||||||
@ -356,7 +359,7 @@ catch2 = static_library(
|
|||||||
sources,
|
sources,
|
||||||
dependencies: catch2_dependencies,
|
dependencies: catch2_dependencies,
|
||||||
include_directories: '..',
|
include_directories: '..',
|
||||||
install: true,
|
install: get_option('install'),
|
||||||
)
|
)
|
||||||
|
|
||||||
catch2_dep = declare_dependency(
|
catch2_dep = declare_dependency(
|
||||||
@ -364,19 +367,21 @@ catch2_dep = declare_dependency(
|
|||||||
include_directories: '..',
|
include_directories: '..',
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg.generate(
|
if get_option('install')
|
||||||
catch2,
|
pkg.generate(
|
||||||
filebase: 'catch2',
|
catch2,
|
||||||
description: 'A modern, C++-native, test framework for C++14 and above',
|
filebase: 'catch2',
|
||||||
url: 'https://github.com/catchorg/Catch2',
|
description: 'A modern, C++-native, test framework for C++14 and above',
|
||||||
)
|
url: 'https://github.com/catchorg/Catch2',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
|
||||||
catch2_with_main = static_library(
|
catch2_with_main = static_library(
|
||||||
'Catch2Main',
|
'Catch2Main',
|
||||||
'internal/catch_main.cpp',
|
'internal/catch_main.cpp',
|
||||||
link_with: catch2,
|
link_with: catch2,
|
||||||
include_directories: '..',
|
include_directories: '..',
|
||||||
install: true,
|
install: get_option('install'),
|
||||||
)
|
)
|
||||||
|
|
||||||
catch2_with_main_dep = declare_dependency(
|
catch2_with_main_dep = declare_dependency(
|
||||||
@ -384,9 +389,11 @@ catch2_with_main_dep = declare_dependency(
|
|||||||
include_directories: '..',
|
include_directories: '..',
|
||||||
)
|
)
|
||||||
|
|
||||||
pkg.generate(
|
if get_option('install')
|
||||||
catch2_with_main,
|
pkg.generate(
|
||||||
filebase: 'catch2-with-main',
|
catch2_with_main,
|
||||||
description: 'A modern, C++-native, test framework for C++14 and above (links in default main)',
|
filebase: 'catch2-with-main',
|
||||||
requires: 'catch2 = ' + meson.project_version(),
|
description: 'A modern, C++-native, test framework for C++14 and above (links in default main)',
|
||||||
)
|
requires: 'catch2 = ' + meson.project_version(),
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
Loading…
Reference in New Issue
Block a user