Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMichal Bukovský2024-11-30 20:17:02 +0100
committerMartin Hořeňovský2025-01-05 20:10:45 +0100
commit6e9c34aa2015c3dca102451b00b7e0f5af273d9c (patch)
tree77286c64169a3f51397adbf24214f35f46f9ca36
parent7d7b2f89f24cbd277f6eb6912705e5e13c68a3c7 (diff)
downloadcatch3-6e9c34aa2015c3dca102451b00b7e0f5af273d9c.tar.gz
add meson option to not install library
-rw-r--r--meson_options.txt1
-rw-r--r--src/catch2/meson.build37
2 files changed, 23 insertions, 15 deletions
diff --git a/meson_options.txt b/meson_options.txt
index 76904873..b460f2de 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1 +1,2 @@
option('tests', type: 'boolean', value: true, description: 'Build the unit tests')
+option('install', type: 'boolean', value: true, description: 'Install the library')
diff --git a/src/catch2/meson.build b/src/catch2/meson.build
index 65be3437..2eb53991 100644
--- a/src/catch2/meson.build
+++ b/src/catch2/meson.build
@@ -16,6 +16,7 @@ configure_file(
format: 'cmake@',
install_dir: get_option('includedir') / 'catch2',
configuration: conf_data,
+ install: get_option('install')
)
fs = import('fs')
@@ -339,7 +340,9 @@ foreach file : headers
endif
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
catch2_dependencies = []
@@ -356,7 +359,7 @@ catch2 = static_library(
sources,
dependencies: catch2_dependencies,
include_directories: '..',
- install: true,
+ install: get_option('install'),
)
catch2_dep = declare_dependency(
@@ -364,19 +367,21 @@ catch2_dep = declare_dependency(
include_directories: '..',
)
-pkg.generate(
- catch2,
- filebase: 'catch2',
- description: 'A modern, C++-native, test framework for C++14 and above',
- url: 'https://github.com/catchorg/Catch2',
-)
+if get_option('install')
+ pkg.generate(
+ catch2,
+ filebase: '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(
'Catch2Main',
'internal/catch_main.cpp',
link_with: catch2,
include_directories: '..',
- install: true,
+ install: get_option('install'),
)
catch2_with_main_dep = declare_dependency(
@@ -384,9 +389,11 @@ catch2_with_main_dep = declare_dependency(
include_directories: '..',
)
-pkg.generate(
- catch2_with_main,
- filebase: 'catch2-with-main',
- description: 'A modern, C++-native, test framework for C++14 and above (links in default main)',
- requires: 'catch2 = ' + meson.project_version(),
-)
+if get_option('install')
+ pkg.generate(
+ catch2_with_main,
+ filebase: 'catch2-with-main',
+ description: 'A modern, C++-native, test framework for C++14 and above (links in default main)',
+ requires: 'catch2 = ' + meson.project_version(),
+ )
+endif