From 8728018f93a73b08a68ab1cea502a5f6b4a2a79e Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Fri, 4 May 2018 15:35:08 +0200 Subject: Regenerate libformat using bdep-new --- libformat/libformat/.gitignore | 3 +++ libformat/libformat/buildfile | 39 +++++++++++++++++++++++++++----------- libformat/libformat/export.hxx | 18 ++++++++---------- libformat/libformat/format.cxx | 4 +--- libformat/libformat/format.hxx | 6 ++---- libformat/libformat/version.hxx.in | 33 ++++++++++++++++++++++++++++++++ 6 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 libformat/libformat/.gitignore create mode 100644 libformat/libformat/version.hxx.in (limited to 'libformat/libformat') diff --git a/libformat/libformat/.gitignore b/libformat/libformat/.gitignore new file mode 100644 index 0000000..0c9102a --- /dev/null +++ b/libformat/libformat/.gitignore @@ -0,0 +1,3 @@ +# Generated version header. +# +version.hxx diff --git a/libformat/libformat/buildfile b/libformat/libformat/buildfile index fc342d4..96f7133 100644 --- a/libformat/libformat/buildfile +++ b/libformat/libformat/buildfile @@ -1,4 +1,27 @@ -lib{format}: {hxx cxx}{format} hxx{export} +int_libs = # Interface dependencies. +imp_libs = # Implementation dependencies. +#import imp_libs += libhello%lib{hello} + +lib{format}: {hxx ixx txx cxx}{* -version} hxx{version} $imp_libs $int_libs + +# Include the generated version header into the distribution (so that we don't +# pick up an installed one) and don't remove it when cleaning in src (so that +# clean results in a state identical to distributed). +# +hxx{version}: in{version} $src_root/file{manifest} +hxx{version}: dist = true +hxx{version}: clean = ($src_root != $out_root) + +cxx.poptions =+ "-I$out_root" "-I$src_root" +lib{format}: cxx.export.poptions = "-I$out_root" "-I$src_root" + +liba{format}: cxx.export.poptions += -DLIBFORMAT_STATIC +libs{format}: cxx.export.poptions += -DLIBFORMAT_SHARED + +obja{*}: cxx.poptions += -DLIBFORMAT_STATIC_BUILD +objs{*}: cxx.poptions += -DLIBFORMAT_SHARED_BUILD + +lib{format}: cxx.export.libs = $int_libs # For pre-releases use the complete version to make sure they cannot be used # in place of another pre-release or the final version. @@ -8,14 +31,8 @@ if $version.pre_release else lib{format}: bin.lib.version = @"-$version.major.$version.minor" -cxx.poptions =+ "-I$out_root" "-I$src_root" -obja{*}: cxx.poptions += -DLIBFORMAT_STATIC_BUILD -objs{*}: cxx.poptions += -DLIBFORMAT_SHARED_BUILD - -lib{format}: cxx.export.poptions = "-I$out_root" "-I$src_root" -liba{format}: cxx.export.poptions += -DLIBFORMAT_STATIC -libs{format}: cxx.export.poptions += -DLIBFORMAT_SHARED - -# Install into the libformat/ subdirectory of, say, /usr/include/. +# Install into the libformat/ subdirectory of, say, /usr/include/ +# recreating subdirectories. # -{hxx ixx txx}{*}: install = include/$project/ +{hxx ixx txx}{*}: install = include/$project/ +{hxx ixx txx}{*}: install.subdirs = true diff --git a/libformat/libformat/export.hxx b/libformat/libformat/export.hxx index 125c9df..1691181 100644 --- a/libformat/libformat/export.hxx +++ b/libformat/libformat/export.hxx @@ -1,30 +1,28 @@ -// file: libformat/export.hxx -*- C++ -*- - #pragma once // Normally we don't export class templates (but do complete specializations), // inline functions, and classes with only inline member functions. Exporting // classes that inherit from non-exported/imported bases (e.g., std::string) // will end up badly. The only known workarounds are to not inherit or to not -// export. Also, MinGW GCC doesn't like seeing non-exported function being +// export. Also, MinGW GCC doesn't like seeing non-exported functions being // used before their inline definition. The workaround is to reorder code. In // the end it's all trial and error. #if defined(LIBFORMAT_STATIC) // Using static. -# define LIBFORMAT_EXPORT +# define LIBFORMAT_SYMEXPORT #elif defined(LIBFORMAT_STATIC_BUILD) // Building static. -# define LIBFORMAT_EXPORT +# define LIBFORMAT_SYMEXPORT #elif defined(LIBFORMAT_SHARED) // Using shared. # ifdef _WIN32 -# define LIBFORMAT_EXPORT __declspec(dllimport) +# define LIBFORMAT_SYMEXPORT __declspec(dllimport) # else -# define LIBFORMAT_EXPORT +# define LIBFORMAT_SYMEXPORT # endif #elif defined(LIBFORMAT_SHARED_BUILD) // Building shared. # ifdef _WIN32 -# define LIBFORMAT_EXPORT __declspec(dllexport) +# define LIBFORMAT_SYMEXPORT __declspec(dllexport) # else -# define LIBFORMAT_EXPORT +# define LIBFORMAT_SYMEXPORT # endif #else // If none of the above macros are defined, then we assume we are being used @@ -32,5 +30,5 @@ // type. Note that this fallback works for both static and shared but in case // of shared will be sub-optimal compared to having dllimport. // -# define LIBFORMAT_EXPORT // Using static or shared. +# define LIBFORMAT_SYMEXPORT // Using static or shared. #endif diff --git a/libformat/libformat/format.cxx b/libformat/libformat/format.cxx index 493f13c..de8a782 100644 --- a/libformat/libformat/format.cxx +++ b/libformat/libformat/format.cxx @@ -1,5 +1,3 @@ -// file: libformat/format.cxx -*- C++ -*- - #include #include // to{upper,lower}() @@ -10,7 +8,7 @@ using namespace std; namespace format { string - message (const string& g, const string& n, volume v) + format_hello (const string& g, const string& n, volume v) { string r (g); diff --git a/libformat/libformat/format.hxx b/libformat/libformat/format.hxx index c711c16..3641b67 100644 --- a/libformat/libformat/format.hxx +++ b/libformat/libformat/format.hxx @@ -1,5 +1,3 @@ -// file: libformat/format.hxx -*- C++ -*- - #pragma once #include @@ -10,6 +8,6 @@ namespace format { enum class volume {quiet, normal, loud}; - LIBFORMAT_EXPORT std::string - message (const std::string& greeting, const std::string& name, volume); + LIBFORMAT_SYMEXPORT std::string + format_hello (const std::string& greeting, const std::string& name, volume); } diff --git a/libformat/libformat/version.hxx.in b/libformat/libformat/version.hxx.in new file mode 100644 index 0000000..eee04b1 --- /dev/null +++ b/libformat/libformat/version.hxx.in @@ -0,0 +1,33 @@ +#pragma once + +// The numeric version format is AAABBBCCCDDDE where: +// +// AAA - major version number +// BBB - minor version number +// CCC - bugfix version number +// DDD - alpha / beta (DDD + 500) version number +// E - final (0) / snapshot (1) +// +// When DDDE is not 0, 1 is subtracted from AAABBBCCC. For example: +// +// Version AAABBBCCCDDDE +// +// 0.1.0 0000010000000 +// 0.1.2 0000010010000 +// 1.2.3 0010020030000 +// 2.2.0-a.1 0020019990010 +// 3.0.0-b.2 0029999995020 +// 2.2.0-a.1.z 0020019990011 +// +#define LIBFORMAT_VERSION $libformat.version.project_number$ULL +#define LIBFORMAT_VERSION_STR "$libformat.version.project$" +#define LIBFORMAT_VERSION_ID "$libformat.version.project_id$" + +#define LIBFORMAT_VERSION_MAJOR $libformat.version.major$ +#define LIBFORMAT_VERSION_MINOR $libformat.version.minor$ +#define LIBFORMAT_VERSION_PATCH $libformat.version.patch$ + +#define LIBFORMAT_PRE_RELEASE $libformat.version.pre_release$ + +#define LIBFORMAT_SNAPSHOT_SN $libformat.version.snapshot_sn$ULL +#define LIBFORMAT_SNAPSHOT_ID "$libformat.version.snapshot_id$" -- cgit v1.1