Commit 1c69f04d authored by Florian Fischer's avatar Florian Fischer
Browse files

[meson] fix version header custom target for meson >= 0.57

Apparently custom_target no longer supports the @CURRENT_SOURCE_DIR@
and @SOURCE_DIR@ substitutions.
We now locate the script using find_program().
Since meson.project_source_dir() is not available in older meson version
there is a version check.
parent 5969872d
Pipeline #58702 failed with stages
in 1 minute and 5 seconds
emper_include = include_directories('.')
emper_version_h = custom_target(
'emper-version.h',
output: 'emper-version.h',
command: [
'@CURRENT_SOURCE_DIR@/generateVersionHeader.sh',
'generate',
meson.project_version(),
'@OUTPUT@',
'@SOURCE_DIR@',
]
)
versionHeaderScript = find_program('generateVersionHeader.sh')
meson_version = meson.version().split('.')
major = meson_version[0].to_int()
minor = meson_version[1].to_int()
if major > 0 or minor > 56
emper_version_h = custom_target(
'emper-version.h',
output: 'emper-version.h',
command: [
versionHeaderScript,
'generate',
meson.project_version(),
'@OUTPUT@',
meson.project_source_root(),
]
)
else
emper_version_h = custom_target(
'emper-version.h',
output: 'emper-version.h',
command: [
versionHeaderScript,
'generate',
meson.project_version(),
'@OUTPUT@',
'@SOURCE_DIR@',
]
)
endif
emper_generated_files += emper_version_h
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment