summaryrefslogtreecommitdiff
path: root/deps/Unity/meson.build
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-24 22:47:46 +1100
commit7b3afcaf77f96e7d62f6cd1623ead7f17512d79f (patch)
treeb5f82c64e9c06a84e4d095ab4ac48712e860b673 /deps/Unity/meson.build
parentb047be5252aeb981faea077409c1768fda0301d9 (diff)
repo init. partial port of existing code
Diffstat (limited to 'deps/Unity/meson.build')
-rw-r--r--deps/Unity/meson.build80
1 files changed, 80 insertions, 0 deletions
diff --git a/deps/Unity/meson.build b/deps/Unity/meson.build
new file mode 100644
index 0000000..6585129
--- /dev/null
+++ b/deps/Unity/meson.build
@@ -0,0 +1,80 @@
+#
+# build script written by : Michael Gene Brockus.
+# github repo author: Mike Karlesky, Mark VanderVoord, Greg Williams.
+#
+# license: MIT
+#
+project('unity', 'c',
+ license: 'MIT',
+
+ # Set project version to value extracted from unity.h header
+ version: run_command(
+ [
+ 'auto/extract_version.py',
+ 'src/unity.h'
+ ],
+ check: true
+ ).stdout().strip(),
+
+ meson_version: '>=0.47.0',
+ default_options: [
+ 'werror=true',
+ 'c_std=c11'
+ ]
+)
+
+build_fixture = get_option('extension_fixture')
+build_memory = get_option('extension_memory')
+support_double = get_option('support_double')
+
+unity_args = []
+unity_src = []
+unity_inc = []
+
+subdir('src')
+
+if build_fixture
+ # Building the fixture extension implies building the memory
+ # extension.
+ build_memory = true
+ subdir('extras/fixture/src')
+endif
+
+if build_memory
+ subdir('extras/memory/src')
+endif
+
+if support_double
+ unity_args += '-DUNITY_INCLUDE_DOUBLE'
+endif
+
+unity_lib = static_library(meson.project_name(),
+ sources: unity_src,
+ c_args: unity_args,
+ include_directories: unity_inc,
+ install: not meson.is_subproject(),
+)
+
+unity_dep = declare_dependency(
+ link_with: unity_lib,
+ include_directories: unity_inc
+)
+
+# Generate pkg-config file.
+if not meson.is_subproject()
+ pkg = import('pkgconfig')
+ pkg.generate(
+ name: meson.project_name(),
+ version: meson.project_version(),
+ libraries: [ unity_lib ],
+ description: 'C Unit testing framework.'
+ )
+endif
+
+# Create a generator that can be used by consumers of our build system to generate
+# test runners.
+gen_test_runner = generator(
+ find_program('auto/generate_test_runner.rb'),
+ output: '@BASENAME@_Runner.c',
+ arguments: ['@INPUT@', '@OUTPUT@']
+)