diff --git a/meson.build b/meson.build index 2864a6118..8b4919410 100644 --- a/meson.build +++ b/meson.build @@ -108,18 +108,6 @@ add_project_arguments( cc.get_supported_arguments(possible_cc_flags), language : 'c') -vcs_tagger = [meson.source_root() + '/misc/meson-vcs-tag.sh', - meson.source_root(), - get_option('version-tag'), - meson.project_version()] - -version_h = vcs_tag( - input : 'src/version.h.in', - output : 'version.h', - command: vcs_tagger) - -versiondep = declare_dependency(sources: version_h) - subdir('configs') subdir('lib') subdir('src') diff --git a/meson_options.txt b/meson_options.txt deleted file mode 100644 index 816f0669f..000000000 --- a/meson_options.txt +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (C) 2019 by Sukchan Lee - -# This file is part of Open5GS. - -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -option('version-tag', type : 'string', - description : 'override the git version string') diff --git a/misc/meson-vcs-tag.sh b/misc/meson-vcs-tag.sh deleted file mode 100755 index 5dc95fa8c..000000000 --- a/misc/meson-vcs-tag.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -set -eu -set -o pipefail - -dir="$1" -tag="$2" -fallback="$3" - -if [ -n "$tag" ]; then - echo "$tag" - exit 0 -fi - -# Apparently git describe has a bug where it always considers the work-tree -# dirty when invoked with --git-dir (even though 'git status' is happy). Work -# around this issue by cd-ing to the source directory. -cd "$dir" -# Check that we have either .git/ (a normal clone) or a .git file (a work-tree) -# and that we don't get confused if a tarball is extracted in a higher-level -# git repository. -[ -e .git ] && git describe --abbrev=7 --dirty=+ 2>/dev/null | sed 's/^v//' || echo "$fallback" diff --git a/src/meson.build b/src/meson.build index 7e3638064..1774e3726 100644 --- a/src/meson.build +++ b/src/meson.build @@ -17,6 +17,21 @@ srcinc = include_directories('.') +#version_conf = configuration_data() +#version_conf.set_quoted('OPEN5GS_VERSION', meson.project_version()) +#configure_file(output : 'version.h', configuration : version_conf) + +version_data = configuration_data() +version_data.set_quoted('OPEN5GS_VERSION', '@VCS_TAG@') + +version_h = vcs_tag( + input : configure_file( + output : 'version.h.in', + configuration : version_data), + output : 'version.h') + +versiondep = declare_dependency(sources: version_h) + subdir('mme') subdir('hss') subdir('sgw') diff --git a/src/version.h.in b/src/version.h.in deleted file mode 100644 index c4075c3bc..000000000 --- a/src/version.h.in +++ /dev/null @@ -1 +0,0 @@ -#define OPEN5GS_VERSION "@VCS_TAG@"