From 3bd426dce9d6c9e37dc08e9591a2caa6fa1fdb20 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Sat, 24 Jun 2017 11:14:10 +0200 Subject: Add build system support for modularization --- libbutl/buildfile | 6 ++++-- libbutl/export.hxx | 10 +++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) (limited to 'libbutl') diff --git a/libbutl/buildfile b/libbutl/buildfile index 42fc421..28cbc7b 100644 --- a/libbutl/buildfile +++ b/libbutl/buildfile @@ -71,9 +71,11 @@ if $version.pre_release else lib{butl}: bin.lib.version = @"-$version.major.$version.minor" +bmi{*}: cxx.poptions += -DLIBBUTL_MODULE_BUILD + cxx.poptions =+ "-I$out_root" "-I$src_root" -obja{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD -objs{*}: cxx.poptions += -DLIBBUTL_SHARED_BUILD +obja{*} bmia{*}: cxx.poptions += -DLIBBUTL_STATIC_BUILD +objs{*} bmis{*}: cxx.poptions += -DLIBBUTL_SHARED_BUILD lib{butl}: cxx.export.poptions = "-I$out_root" "-I$src_root" liba{butl}: cxx.export.poptions += -DLIBBUTL_STATIC diff --git a/libbutl/export.hxx b/libbutl/export.hxx index 3c2d2a9..5c59539 100644 --- a/libbutl/export.hxx +++ b/libbutl/export.hxx @@ -5,6 +5,14 @@ #ifndef LIBBUTL_EXPORT_HXX #define LIBBUTL_EXPORT_HXX +// If we are compiling a module interface, setup the module export. +// +#ifdef LIBBUTL_MODULE_BUILD +# define LIBBUTL_MODEXPORT export +#else +# define LIBBUTL_MODEXPORT +#endif + // 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) @@ -35,7 +43,7 @@ // 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 LIBBUTL_SYMEXPORT // Using static or shared. +# define LIBBUTL_SYMEXPORT // Using static or shared. #endif #endif // LIBBUTL_EXPORT_HXX -- cgit v1.1