Skip to content

Commit b97beb3

Browse files
committed
Add version header generation support
1 parent f4f98d2 commit b97beb3

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/iceberg/meson.build

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,29 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18+
conf_data = configuration_data()
19+
version = meson.project_version()
20+
components = version.split('.')
21+
assert(
22+
components.length() >= 3,
23+
'The version does not contain major, minor and patch',
24+
)
25+
ver_major = components[0]
26+
ver_minor = components[1]
27+
ver_patch = components[2]
28+
conf_data.set('PROJECT_VERSION_MAJOR', ver_major)
29+
conf_data.set('PROJECT_VERSION_MINOR', ver_minor)
30+
conf_data.set('PROJECT_VERSION_PATCH', ver_patch)
31+
conf_data.set('PROJECT_VERSION', version)
32+
conf_data.set('PROJECT_NAME', meson.project_name())
33+
configure_file(
34+
input: 'version.h.in',
35+
output: 'version.h',
36+
configuration: conf_data,
37+
install: true,
38+
install_dir: get_option('includedir') / 'iceberg',
39+
)
40+
1841
iceberg_include_dir = include_directories('..')
1942
iceberg_sources = files(
2043
'arrow_c_data_guard_internal.cc',

0 commit comments

Comments
 (0)