Skip to content

Commit efb67a1

Browse files
authored
Merge pull request #1489 from joto/version-with-build-type
Report build type when calling with --version
2 parents 47cfbbc + 29d15b8 commit efb67a1

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

src/options.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include "options.hpp"
1515
#include "reprojection.hpp"
1616
#include "sprompt.hpp"
17+
#include "version.hpp"
1718

1819
#include <algorithm>
1920
#include <cstdio>
@@ -564,6 +565,7 @@ options_t::options_t(int argc, char *argv[]) : options_t()
564565
reproject_area = true;
565566
break;
566567
case 'V':
568+
fmt::print(stderr, "Build: {}\n", get_build_type());
567569
fmt::print(stderr, "Compiled using the following library versions:\n");
568570
fmt::print(stderr, "Libosmium {}\n", LIBOSMIUM_VERSION_STRING);
569571
fmt::print(stderr, "Proj {}\n", get_proj_version());

src/version.cpp.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* For a full list of authors see the git log.
88
*/
99

10+
char const *get_build_type() noexcept
11+
{
12+
return "@CMAKE_BUILD_TYPE@";
13+
}
14+
1015
char const *get_osm2pgsql_version() noexcept
1116
{
1217
return "@PACKAGE_VERSION@@VERSION_FROM_GIT@";

src/version.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* For a full list of authors see the git log.
1111
*/
1212

13+
char const *get_build_type() noexcept;
1314
char const *get_osm2pgsql_version() noexcept;
1415
char const *get_osm2pgsql_short_version() noexcept;
1516
char const *get_minimum_postgresql_server_version() noexcept;

0 commit comments

Comments
 (0)