Merge branch 'version-header' into 'master'

(#2): Generate a header file with the version number

Closes #2

See merge request federicomenaquintero/bzip2!24
This commit is contained in:
Federico Mena Quintero 2019-06-25 23:59:30 +00:00
commit 78aa9c8623
5 changed files with 17 additions and 2 deletions

View File

@ -16,6 +16,13 @@ set(LT_AGE 0)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
include(Version)
set(BZ_VERSION ${PROJECT_VERSION})
configure_file (
"${PROJECT_SOURCE_DIR}/bz_version.h.in"
"${PROJECT_BINARY_DIR}/bz_version.h"
)
include_directories("${PROJECT_BINARY_DIR}")
math(EXPR LT_SOVERSION "${LT_CURRENT} - ${LT_AGE}")
set(LT_VERSION "${LT_SOVERSION}.${LT_AGE}.${LT_REVISION}")
set(PACKAGE_VERSION "${PROJECT_VERSION}")

1
bz_version.h.in Normal file
View File

@ -0,0 +1 @@
#define BZ_VERSION "@BZ_VERSION@"

View File

@ -29,6 +29,7 @@
*/
#include "bzlib_private.h"
#include "bz_version.h"
/*---------------------------------------------------*/

View File

@ -36,8 +36,6 @@
/*-- General stuff. --*/
#define BZ_VERSION "1.0.6, 6-Sept-2010"
typedef char Char;
typedef unsigned char Bool;
typedef unsigned char UChar;

View File

@ -6,6 +6,14 @@ project(
default_options : ['c_std=c89', 'warning_level=1'],
)
conf_data = configuration_data()
conf_data.set('BZ_VERSION', meson.project_version())
configure_file(
input: 'bz_version.h.in',
output: 'bz_version.h',
configuration: conf_data
)
cc = meson.get_compiler('c')
add_project_arguments(cc.get_supported_arguments([
'-Winline',