From 0921c263f4fcef5da10531db61ec6eac89137a70 Mon Sep 17 00:00:00 2001 From: Ross Smyth Date: Wed, 5 Mar 2025 16:22:40 -0500 Subject: [PATCH 1/2] Allow the memory extra and fixture extra to be enabled seperatly. --- meson.build | 7 +++---- meson_options.txt | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 6585129c..e16bce09 100644 --- a/meson.build +++ b/meson.build @@ -34,14 +34,13 @@ 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 +if build_memory.enabled() or (build_memory.auto() and build_fixture) subdir('extras/memory/src') +else + unity_args += '-DUNITY_FIXTURE_NO_EXTRAS' endif if support_double diff --git a/meson_options.txt b/meson_options.txt index 8e66784b..069b19d1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,3 @@ -option('extension_fixture', type: 'boolean', value: 'false', description: 'Whether to enable the fixture extension.') -option('extension_memory', type: 'boolean', value: 'false', description: 'Whether to enable the memory extension.') -option('support_double', type: 'boolean', value: 'false', description: 'Whether to enable double precision floating point assertions.') +option('extension_fixture', type: 'boolean', value: false, description: 'Whether to enable the fixture extension.') +option('extension_memory', type: 'feature', value: 'auto', description: 'Whether to enable the memory extension. By default this is automatically enabled when extension_fixture is enabled.') +option('support_double', type: 'boolean', value: false, description: 'Whether to enable double precision floating point assertions.') From 8badc0e070f47f275b50885b6eacad06d917022d Mon Sep 17 00:00:00 2001 From: Ross Smyth Date: Wed, 5 Mar 2025 16:31:13 -0500 Subject: [PATCH 2/2] Add fixture help message option for UNITY_CUSTOM_HELP_MSG --- meson.build | 4 ++++ meson_options.txt | 1 + 2 files changed, 5 insertions(+) diff --git a/meson.build b/meson.build index e16bce09..419e09ea 100644 --- a/meson.build +++ b/meson.build @@ -26,6 +26,7 @@ project('unity', 'c', build_fixture = get_option('extension_fixture') build_memory = get_option('extension_memory') support_double = get_option('support_double') +fixture_help_message = get_option('fixture_help_message') unity_args = [] unity_src = [] @@ -35,6 +36,9 @@ subdir('src') if build_fixture subdir('extras/fixture/src') + if fixture_help_message != '' + unity_args += '-DUNITY_CUSTOM_HELP_MSG=' + fixture_help_message + endif endif if build_memory.enabled() or (build_memory.auto() and build_fixture) diff --git a/meson_options.txt b/meson_options.txt index 069b19d1..264480cf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option('extension_fixture', type: 'boolean', value: false, description: 'Whether to enable the fixture extension.') option('extension_memory', type: 'feature', value: 'auto', description: 'Whether to enable the memory extension. By default this is automatically enabled when extension_fixture is enabled.') option('support_double', type: 'boolean', value: false, description: 'Whether to enable double precision floating point assertions.') +option('fixture_help_message', type: 'string', description: 'If the fixture extension is enabled, this allows a custom help message to be defined.')