]> git.tdb.fi Git - builder.git/commitdiff
Add visibility decorations to the library and plugins
authorMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 10:57:31 +0000 (12:57 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 10:57:51 +0000 (12:57 +0200)
53 files changed:
plugins/android/androidplugin.cpp
plugins/base/baseplugin.cpp
plugins/clang/clangplugin.cpp
plugins/datafile/datafileplugin.cpp
plugins/gnu/gnuplugin.cpp
plugins/msvc/msvcplugin.cpp
source/lib/architecture.h
source/lib/binary.h
source/lib/binarycomponent.h
source/lib/binarypackage.h
source/lib/builder.h
source/lib/buildgraph.h
source/lib/buildinfo.h
source/lib/buildtype.h
source/lib/cache.h
source/lib/chainedtask.h
source/lib/component.h
source/lib/conditionalloader.h
source/lib/config.h
source/lib/csourcefile.h
source/lib/customizedtool.h
source/lib/executable.h
source/lib/exportdefinitions.h
source/lib/externaltask.h
source/lib/file.h
source/lib/filetarget.h
source/lib/importlibrary.h
source/lib/installcomponent.h
source/lib/installedfile.h
source/lib/installmap.h
source/lib/internaltask.h
source/lib/libbuilder_api.h [new file with mode: 0644]
source/lib/logger.h
source/lib/objcsourcefile.h
source/lib/objectfile.h
source/lib/package.h
source/lib/packagemanager.h
source/lib/pattern.h
source/lib/plugin.h
source/lib/sharedlibrary.h
source/lib/sourcearchivecomponent.h
source/lib/sourcefile.h
source/lib/sourcepackage.h
source/lib/staticlibrary.h
source/lib/sysutils.cpp
source/lib/sysutils.h
source/lib/target.h
source/lib/task.h
source/lib/templatefile.h
source/lib/tool.h
source/lib/toolchain.h
source/lib/virtualfilesystem.h
source/lib/virtualtarget.h

index 609d5cd5d12815a744e5d176ebb17f971bc5654e..055a0d85bd6de278b6314862af3c9e8a8b5e18b4 100644 (file)
@@ -17,8 +17,16 @@ void AndroidPlugin::add_tools(Toolchain &toolchain, const Architecture &arch) co
 }
 
 
+#if defined(_WIN32)
+#define ANDROIDTOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define ANDROIDTOOLS_API __attribute__((visibility("default")))
+#else
+#define ANDROIDTOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+ANDROIDTOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new AndroidPlugin(builder);
 }
index 96ce2faed0c390bd67177f854b3849e102381f9d..0da610ce8def2237e7e490730c8e8a683ea90bb8 100644 (file)
@@ -24,8 +24,16 @@ void BasePlugin::create_targets(SourcePackage &spkg) const
 }
 
 
+#if defined(_WIN32)
+#define BASETOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define BASETOOLS_API __attribute__((visibility("default")))
+#else
+#define BASETOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+BASETOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new BasePlugin(builder);
 }
index a6b3bbb498dc483dfb7ba7b81962db5b20725b4b..eecbdc6128f21181118ca6f73172b81e97fa4263 100644 (file)
@@ -7,8 +7,16 @@ void ClangPlugin::add_tools(Toolchain &toolchain, const Architecture &arch) cons
 }
 
 
+#if defined(_WIN32)
+#define CLANGTOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define CLANGTOOLS_API __attribute__((visibility("default")))
+#else
+#define CLANGTOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+CLANGTOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new ClangPlugin(builder);
 }
index a085724435fb2446157861ec1cda5650beb72342..134ec0e18aaff4b596962b6d54555217320ceeb3 100644 (file)
@@ -15,8 +15,16 @@ void DataFilePlugin::add_tools(Toolchain &toolchain, const Architecture &) const
 }
 
 
+#if defined(_WIN32)
+#define DATATOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define DATATOOLS_API __attribute__((visibility("default")))
+#else
+#define DATATOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+DATATOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new DataFilePlugin(builder);
 }
index a758b9a2c0c23d79e58b52c766d721624664e2ac..db8c300eeb6598237e569e0863df0149552c2482 100644 (file)
@@ -7,8 +7,16 @@ void GnuPlugin::add_tools(Toolchain &toolchain, const Architecture &arch) const
 }
 
 
+#if defined(_WIN32)
+#define GNUTOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define GNUTOOLS_API __attribute__((visibility("default")))
+#else
+#define GNUTOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+GNUTOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new GnuPlugin(builder);
 }
index 9ebf24a5f517809894bdfc81a09c038983fbc1c1..bf1e26e3ba33990f560a6aa1ea7caa3f3f755785 100644 (file)
@@ -23,8 +23,16 @@ void MsvcPlugin::create_targets(SourcePackage &spkg) const
 }
 
 
+#if defined(_WIN32)
+#define MSVCTOOLS_API __declspec(dllexport)
+#elif defined(__GNUC__)
+#define MSVCTOOLS_API __attribute__((visibility("default")))
+#else
+#define MSVCTOOLS_API
+#endif
+
 extern "C"
-Plugin *create_plugin(Builder &builder)
+MSVCTOOLS_API Plugin *create_plugin(Builder &builder)
 {
        return new MsvcPlugin(builder);
 }
index 2cf4fa2fdff88bd9014e7cd800aa4754b1d9f3a0..8f3cdc7ffe42d525afb75a5937931582afc7fc69 100644 (file)
@@ -4,6 +4,7 @@
 #include <typeinfo>
 #include <msp/datafile/loader.h>
 #include "buildinfo.h"
+#include "libbuilder_api.h"
 #include "pattern.h"
 
 class Builder;
@@ -12,7 +13,7 @@ class Builder;
 Stores information about an architecture.  This includes CPU type, model and
 bitness and operating system.
 */
-class Architecture
+class LIBBUILDER_API Architecture
 {
 public:
        class Loader: public Msp::DataFile::ObjectLoader<Architecture>
index ac5a855a8d2c54cf178edba7850879db58d08ab1..143835cea7c408101e3a2e22a358c6cb733d4848 100644 (file)
@@ -3,6 +3,7 @@
 
 #include "buildinfo.h"
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 class Component;
 class ObjectFile;
@@ -11,7 +12,7 @@ class ObjectFile;
 Produces a binary file, which may be either a standalone executable or a shared
 library.
 */
-class Binary: public FileTarget
+class LIBBUILDER_API Binary: public FileTarget
 {
 private:
        BuildInfo static_binfo;
index eaa123c0a4ae7fcf6d5c02fe481b0389eaee296d..c7abe5792bda42312749a02af4dc1060bcaff169 100644 (file)
@@ -2,12 +2,13 @@
 #define BINARYCOMPONENT_H_
 
 #include "component.h"
+#include "libbuilder_api.h"
 
 class FileTarget;
 class Target;
 class Tool;
 
-class BinaryComponent: public Component
+class LIBBUILDER_API BinaryComponent: public Component
 {
 public:
        class Loader: public Msp::DataFile::DerivedObjectLoader<BinaryComponent, Component::Loader>
index 62a8acf3fc6ba70bc2a2d2c215c7359cf8b8a5d9..b7d3294be7c25b6d9d38f6fd213af61d3e07141c 100644 (file)
@@ -1,13 +1,14 @@
 #ifndef BINARYPACKAGE_H_
 #define BINARYPACKAGE_H_
 
+#include "libbuilder_api.h"
 #include "package.h"
 
 /**
 Represents a package that is installed on the system, but can't be built by
 Builder.
 */
-class BinaryPackage: public Package
+class LIBBUILDER_API BinaryPackage: public Package
 {
 public:
        class Loader: public Msp::DataFile::DerivedObjectLoader<BinaryPackage, Package::Loader>
index 62fc21494e066baee9d5e9c5517974554f549012..984522646b61ac335bd777ae8e1c1ef45d12a95a 100644 (file)
@@ -10,6 +10,7 @@
 #include "buildgraph.h"
 #include "buildtype.h"
 #include "config.h"
+#include "libbuilder_api.h"
 #include "logger.h"
 #include "packagemanager.h"
 #include "sourcepackage.h"
@@ -24,7 +25,7 @@ class Plugin;
 This class ties everything else together.  It also contains code for loading
 build files and supervising the build process.
 */
-class Builder
+class LIBBUILDER_API Builder
 {
 private:
        class Loader: public Msp::DataFile::ObjectLoader<Builder>
index 371b5447e2e01291f8e902103a34d3cb12065565..9092532e158daa4c6018c54f012e92a4790e4283 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <map>
 #include <string>
+#include "libbuilder_api.h"
 
 class Builder;
 class Target;
@@ -10,7 +11,7 @@ class Target;
 /**
 Manages a graph of targets.
 */
-class BuildGraph
+class LIBBUILDER_API BuildGraph
 {
 private:
        Builder &builder;
index 26afabffd4db6f323824ddeba99f98954c78c926..0bb1605d2040f4c6bb2552560493323f037b2eca 100644 (file)
@@ -5,12 +5,13 @@
 #include <vector>
 #include <msp/datafile/objectloader.h>
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 
 /**
 Stores information about compiler command line parameters in a more abstract
 form.  Allows combining with other BuildInfos to support package dependencies.
 */
-class BuildInfo
+class LIBBUILDER_API BuildInfo
 {
 public:
        enum LibraryMode
@@ -28,7 +29,7 @@ public:
                ABSOLUTE   //< Record absolute rpath in binaries
        };
 
-       class Loader: public Msp::DataFile::ObjectLoader<BuildInfo>
+       class LIBBUILDER_API Loader: public Msp::DataFile::ObjectLoader<BuildInfo>
        {
        public:
                Loader(BuildInfo &);
@@ -51,7 +52,7 @@ public:
                CHAINED      //< Include only compilation options
        };
 
-       struct LanguageStandard
+       struct LIBBUILDER_API LanguageStandard
        {
                std::string type;
                unsigned year = 0;
index c16e8f9f24bb5434bcb8a9a8acd192583ccf8ef0..43df567fc4e0fb5471db3f824006e1ddce33c96d 100644 (file)
@@ -4,8 +4,9 @@
 #include <string>
 #include <msp/datafile/objectloader.h>
 #include "buildinfo.h"
+#include "libbuilder_api.h"
 
-class BuildType
+class LIBBUILDER_API BuildType
 {
 public:
        class Loader: public Msp::DataFile::ObjectLoader<BuildType>
index 9193dacec848ae834ac264be6e0bb8ef8bc855a1..6b735b2eebd23265629cacfb7710a0a8ceb12ac6 100644 (file)
@@ -5,6 +5,7 @@
 #include <vector>
 #include <msp/fs/path.h>
 #include <msp/time/timestamp.h>
+#include "libbuilder_api.h"
 
 class SourcePackage;
 class Target;
@@ -17,7 +18,7 @@ Data is stored as lists of strings and keyed to target and an arbitrary
 identifier.  Any kind of strings can be stored, even ones that contain
 unprintable characters or nuls.
 */
-class Cache
+class LIBBUILDER_API Cache
 {
 public:
        using Values = std::vector<std::string>;
index 30a3b3e020020197608b0f05c02223c58db907a9..4363ffa1cab742d2807c2536839c2803fcf59c64 100644 (file)
@@ -2,13 +2,14 @@
 #define CHAINEDTASK_H_
 
 #include <vector>
+#include "libbuilder_api.h"
 #include "task.h"
 
 /**
 Runs multiple tasks as one unit, one after the other.  Execution of the chain
 will stop if any of the component tasks terminates with an error.
 */
-class ChainedTask: public Task
+class LIBBUILDER_API ChainedTask: public Task
 {
 private:
        std::vector<Task *> tasks;
index 816d2c11803c1eb947fb6244590548b71f5fcd84..7d9aa1af704e195efed112cbfbd08e3163f9e285 100644 (file)
@@ -7,6 +7,7 @@
 #include "buildinfo.h"
 #include "conditionalloader.h"
 #include "installmap.h"
+#include "libbuilder_api.h"
 #include "package.h"
 
 class SourcePackage;
@@ -17,10 +18,10 @@ may also build none), as well as install a bunch of headers.  Components inherit
 dependencies and build info from the package they belong to, and may also add
 their own.
 */
-class Component
+class LIBBUILDER_API Component
 {
 public:
-       class Loader: public Msp::DataFile::ObjectLoader<Component>, public ConditionalLoader
+       class LIBBUILDER_API Loader: public Msp::DataFile::ObjectLoader<Component>, public ConditionalLoader
        {
        public:
                Loader(Component &);
index 5184fac5378a4a2db69f8a09237f2aafecc9ad12..1d496abd369a5d968243ba9bd88fd2beb2961b4b 100644 (file)
@@ -3,11 +3,12 @@
 
 #include <string>
 #include <msp/datafile/loader.h>
+#include "libbuilder_api.h"
 
 class Builder;
 class SourcePackage;
 
-class ArchitectureConditional: virtual public Msp::DataFile::Loader
+class LIBBUILDER_API ArchitectureConditional: virtual public Msp::DataFile::Loader
 {
 private:
        const Builder &builder;
@@ -21,7 +22,7 @@ private:
 };
 
 
-class FeatureConditional: virtual public Msp::DataFile::Loader
+class LIBBUILDER_API FeatureConditional: virtual public Msp::DataFile::Loader
 {
 private:
        const SourcePackage &package;
@@ -34,7 +35,7 @@ protected:
 };
 
 
-class ConditionalLoader: public ArchitectureConditional, FeatureConditional
+class LIBBUILDER_API ConditionalLoader: public ArchitectureConditional, FeatureConditional
 {
 protected:
        ConditionalLoader(const SourcePackage &, const std::string &);
index ba8416b923a24128416623c22e08377facf5b220..1c6a9e86557837853e92a6d2c3d384bc02a9f722 100644 (file)
@@ -7,6 +7,7 @@
 #include <msp/fs/path.h>
 #include <msp/time/timestamp.h>
 #include "feature.h"
+#include "libbuilder_api.h"
 
 class SourcePackage;
 
@@ -14,11 +15,11 @@ class SourcePackage;
 Manages configuration for a package.  A configuration may have an arbitary
 amount of options, as well as a modification time (mtime).
 */
-class Config
+class LIBBUILDER_API Config
 {
 public:
        /** A single configuration option. */
-       struct Option: public Feature
+       struct LIBBUILDER_API Option: public Feature
        {
                std::string value;
 
index c57654a4cd6334cd98baba915baca1c1c75ca521..4d5664dd856031dff5313d67e9f0c41b6b1ea659 100644 (file)
@@ -2,12 +2,13 @@
 #define CSOURCEFILE_H_
 
 #include <msp/io/base.h>
+#include "libbuilder_api.h"
 #include "sourcefile.h"
 
 /**
 Represents a C or C++ source file.
 */
-class CSourceFile: public SourceFile
+class LIBBUILDER_API CSourceFile: public SourceFile
 {
 protected:
        std::vector<std::string> includes;
index 55c4c6ad721a612e37dc2861ada5328e58355e00..cd58edbabd529ac9a36f809593ba5561dc9bbea8 100644 (file)
@@ -1,9 +1,10 @@
 #ifndef CUSTOMIZEDTOOL_H_
 #define CUSTOMIZEDTOOL_H_
 
+#include "libbuilder_api.h"
 #include "tool.h"
 
-class CustomizedTool: public Tool
+class LIBBUILDER_API CustomizedTool: public Tool
 {
 protected:
        Tool &parent;
index 5728e2f2eadf1db848b03943a037b61e40729d83..a8311fed57991e8b15ec65fc490417c1fa95a897 100644 (file)
@@ -2,8 +2,9 @@
 #define EXECUTABLE_H_
 
 #include "binary.h"
+#include "libbuilder_api.h"
 
-class Executable: public Binary
+class LIBBUILDER_API Executable: public Binary
 {
 public:
        Executable(Builder &b, const Msp::FS::Path &p): Binary(b, p) { }
index b8631ee2560530ba43ae38867f8401c95325e95f..0535d6359415e63e2152c3e9791b9fdf79a7b373 100644 (file)
@@ -2,13 +2,14 @@
 #define EXPORTDEFINITIONS_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 class ObjectFile;
 
 /**
 An export definition file for a shared library.  Only used on Windows.
 */
-class ExportDefinitions: public FileTarget
+class LIBBUILDER_API ExportDefinitions: public FileTarget
 {
 public:
        ExportDefinitions(Builder &, const Component &, const std::vector<ObjectFile *> &);
index 4a789201b64848c35123f9e4fb3d6394760968d8..8dbdb86cc110e28e0786883cbbd9330b4f73ac92 100644 (file)
@@ -6,6 +6,7 @@
 #include <msp/core/process.h>
 #include <msp/fs/path.h>
 #include <msp/io/pipe.h>
+#include "libbuilder_api.h"
 #include "task.h"
 
 /**
@@ -13,7 +14,7 @@ Runs an external command.  A zero exit status is translated to a SUCCESS status
 for the task, and anything else is treated as an error.  Output can optionally
 be captured.
 */
-class ExternalTask: public Task
+class LIBBUILDER_API ExternalTask: public Task
 {
 public:
        enum StreamAction
index 42d73b8c8366f29d056ff019c2b9c219527230b9..0cbf8cac7eccaefdc11886070c41bcb62516ab85 100644 (file)
@@ -2,11 +2,12 @@
 #define FILE_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 /**
 Just an arbitrary file.  No special meaning attached.
 */
-class File: public FileTarget
+class LIBBUILDER_API File: public FileTarget
 {
 public:
        File(Builder &b, const Msp::FS::Path &t): FileTarget(b, t) { }
index d2ed71954010be4e8824ceba73e9665dab8d583c..124b3c5da5c2ab316309653f1260d5174b80ad35 100644 (file)
@@ -2,13 +2,14 @@
 #define FILETARGET_H_
 
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 #include "target.h"
 
 /**
 An intermediate base class for targets that represent files.  Almost all target
 classes are derived from this.
 */
-class FileTarget: public Target
+class LIBBUILDER_API FileTarget: public Target
 {
 protected:
        Msp::FS::Path path;
index ac2de26e327bd77cf28df493cc9fec353f0b9854..fbcd98ee88521ec2d2384e49e6230f9543279fb4 100644 (file)
@@ -2,6 +2,7 @@
 #define IMPORTLIBRARY_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 class ExportDefinitions;
 class SharedLibrary;
@@ -10,7 +11,7 @@ class SharedLibrary;
 A special case of static library which pulls in a shared library.  Used on
 platforms with no true dynamic linking support.
 */
-class ImportLibrary: public FileTarget
+class LIBBUILDER_API ImportLibrary: public FileTarget
 {
 private:
        SharedLibrary *shared_lib = 0;
index 457256d6d14be9863672e42e7268cce5ebdb9b39..69441c81dc40393b701921f781163a86ad2f013d 100644 (file)
@@ -2,8 +2,9 @@
 #define INSTALLCOMPONENT_H_
 
 #include "component.h"
+#include "libbuilder_api.h"
 
-class InstallComponent: public Component
+class LIBBUILDER_API InstallComponent: public Component
 {
 public:
        InstallComponent(SourcePackage &p, const std::string &n): Component(p, n) { }
index 0dd671f42bf56c745d44d860bd2b6448fcbc41e2..e9dfe17673a94570c3a4707b635b1b55d485ed54 100644 (file)
@@ -1,13 +1,14 @@
 #ifndef INSTALLEDFILE_H_
 #define INSTALLEDFILE_H_
 
-#include "sourcepackage.h"
 #include "filetarget.h"
+#include "libbuilder_api.h"
+#include "sourcepackage.h"
 
 /**
 Represents the installation of a file.
 */
-class InstalledFile: public FileTarget
+class LIBBUILDER_API InstalledFile: public FileTarget
 {
 private:
        FileTarget &source;
index 49211d7676aca975260e4d0a89cbbf9dea9f99a2..6d9501c7672c84e320f026c22f3eac49edfbc31a 100644 (file)
@@ -4,6 +4,7 @@
 #include <vector>
 #include <msp/datafile/objectloader.h>
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 
 class FileTarget;
 
@@ -14,7 +15,7 @@ location are mapped if their default install location shares a common prefix
 with the mapped install location.  The remainder of the source location is
 appended to the mapped install location to form the final install location.
 */
-class InstallMap
+class LIBBUILDER_API InstallMap
 {
 public:
        class Loader: public Msp::DataFile::ObjectLoader<InstallMap>
index 608ea9662609bb0e5912f65a247f193f3a292504..9e553e7114b0daa58c73daa10a03a75acbb868ea 100644 (file)
@@ -3,6 +3,7 @@
 
 #include <functional>
 #include <msp/core/thread.h>
+#include "libbuilder_api.h"
 #include "task.h"
 
 /**
@@ -10,10 +11,10 @@ Runs a worker thread.  Tools should derive a thread class from
 InternalTask::Worker.  The worker thread must set its status to either SUCCESS
 or ERROR before terminating.
 */
-class InternalTask: public Task
+class LIBBUILDER_API InternalTask: public Task
 {
 private:
-       class Worker: public Msp::Thread
+       class LIBBUILDER_API Worker: public Msp::Thread
        {
                friend class InternalTask;
 
diff --git a/source/lib/libbuilder_api.h b/source/lib/libbuilder_api.h
new file mode 100644 (file)
index 0000000..319b27b
--- /dev/null
@@ -0,0 +1,16 @@
+#ifndef LIBBUILDER_API_H_
+#define LIBBUILDER_API_H_
+
+#if defined(_WIN32)
+#if defined(LIBBUILDER_BUILD)
+#define LIBBUILDER_API __declspec(dllexport)
+#elif defined(LIBBUILDER_IMPORT)
+#define LIBBUILDER_API __declspec(dllimport)
+#else
+#define LIBBUILDER_API
+#endif
+#elif defined(__GNUC__)
+#define LIBBUILDER_API __attribute__((visibility("default")))
+#endif
+
+#endif
index 3a10f0e89177e10c071b97cd389c79e4d46a1404..91bda2320f3f694e7426f04996044b75ae26eb8b 100644 (file)
@@ -4,8 +4,9 @@
 #include <string>
 #include <vector>
 #include <msp/strings/format.h>
+#include "libbuilder_api.h"
 
-class Logger
+class LIBBUILDER_API Logger
 {
 private:
        std::vector<std::string> enabled_channels;
index 37f79a3f1f1b9d852857859ef900bb92cd5f185f..3feb05821d82a05f646b51b1ba153ff54543bac0 100644 (file)
@@ -2,11 +2,12 @@
 #define OBJCSOURCEFILE_H_
 
 #include "csourcefile.h"
+#include "libbuilder_api.h"
 
 /**
 Represents an Objective-C source file.
 */
-class ObjCSourceFile: public CSourceFile
+class LIBBUILDER_API ObjCSourceFile: public CSourceFile
 {
 public:
        using CSourceFile::CSourceFile;
index 9e3ff90a77c227cf157db6d8e646586409576bd1..27c9b3339c5801c693004f056f88215b35ffa88c 100644 (file)
@@ -2,13 +2,14 @@
 #define OBJECTFILE_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 class SourceFile;
 
 /**
 Object files are compiled from source files.
 */
-class ObjectFile: public FileTarget
+class LIBBUILDER_API ObjectFile: public FileTarget
 {
 private:
        SourceFile &source;
index 9a10991ec8e94028ae74d27e553ceec233424d87..e64c6986cf9e2a2d6f441cce666cbbde68c9db3d 100644 (file)
@@ -7,6 +7,7 @@
 #include "buildinfo.h"
 #include "conditionalloader.h"
 #include "config.h"
+#include "libbuilder_api.h"
 
 class Builder;
 
@@ -15,7 +16,7 @@ A package is a distributable piece of software.  Package information may be
 obtained in several ways: Build files of source packages, pkg-config for binary
 packages and the builderrc file for binary packages with no pkg-config support.
 */
-class Package
+class LIBBUILDER_API Package
 {
 public:
        class Loader: public Msp::DataFile::ObjectLoader<Package>, public ArchitectureConditional
index fc0aa982e38fd4666800c867b482c07ab1a7b560..4f90d8ba84b17ddde72e65d28522833495f38908 100644 (file)
@@ -6,6 +6,7 @@
 #include <string>
 #include <vector>
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 
 class Builder;
 class Package;
@@ -14,7 +15,7 @@ class Package;
 Keeps track of packages.  Also responsible for locating previously unknown
 packages by name.
 */
-class PackageManager
+class LIBBUILDER_API PackageManager
 {
 private:
        Builder &builder;
index 5da52eb7d1f3a4786fcd76b5a8b0b47e742e563e..bfaee777d46e89dc4b0b2eb390b21b27bf29cad4 100644 (file)
@@ -3,13 +3,14 @@
 
 #include <string>
 #include <vector>
+#include "libbuilder_api.h"
 
 /**
 Stores a filename pattern.  A pattern consists of a prefix and a suffix, and
 can be applied to a body to form a complete filename.  Either or both of the
 prefix and suffix may be empty.
 */
-class Pattern
+class LIBBUILDER_API Pattern
 {
 private:
        std::string prefix;
index 35cdb323c2560c67f98b78148fa6dbb682d49bad..1e79fca802ac466fc3d94d2001f295e2e2aa951a 100644 (file)
@@ -1,12 +1,14 @@
 #ifndef PLUGIN_H_
 #define PLUGIN_H_
 
+#include "libbuilder_api.h"
+
 class Architecture;
 class Builder;
 class SourcePackage;
 class Toolchain;
 
-class Plugin
+class LIBBUILDER_API Plugin
 {
 protected:
        Builder &builder;
index 564b2102004d714da37d3042dd682cf37e488b95..363c6abc03b9fd7b9153beea8365698a0210ec8e 100644 (file)
@@ -2,6 +2,7 @@
 #define SHAREDLIB_H_
 
 #include "binary.h"
+#include "libbuilder_api.h"
 
 class ImportLibrary;
 
@@ -14,7 +15,7 @@ no version, soname will be empty.
 A SharedLibrary can also store a pointer to the associated ImportLibrary, for
 platforms that need one.
 */
-class SharedLibrary: public Binary
+class LIBBUILDER_API SharedLibrary: public Binary
 {
 private:
        std::string libname;
index 94c1bc5bc805d9b2cd2676c9a98882b4fa750089..5c48ffe6f7efda2b6f5d60f2b646b4f970bf5f3c 100644 (file)
@@ -2,8 +2,9 @@
 #define TARBALLCOMPONENT_H_
 
 #include "component.h"
+#include "libbuilder_api.h"
 
-class SourceArchiveComponent: public Component
+class LIBBUILDER_API SourceArchiveComponent: public Component
 {
 public:
        SourceArchiveComponent(SourcePackage &);
index 16521a5576e60fd8e384bb70ffc239d37ab554b2..dd7ca9d3332da7bdc7282719fcd624049526082a 100644 (file)
@@ -2,8 +2,9 @@
 #define SOURCEFILE_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
-class SourceFile: public FileTarget
+class LIBBUILDER_API SourceFile: public FileTarget
 {
 protected:
        SourceFile(Builder &b, const Msp::FS::Path &p): FileTarget(b, p) { }
index d458c9094208c9c86ff4755bb34d9bb47aa6d3b7..6644262c2f710c15844e69b014c15cd018ca1359 100644 (file)
@@ -11,6 +11,7 @@
 #include "conditionalloader.h"
 #include "config.h"
 #include "feature.h"
+#include "libbuilder_api.h"
 #include "package.h"
 #include "toolchain.h"
 
@@ -21,7 +22,7 @@ class SourceArchiveComponent;
 /**
 A package that can be built by Builder.
 */
-class SourcePackage: public Package
+class LIBBUILDER_API SourcePackage: public Package
 {
 public:
        class Loader: public Msp::DataFile::DerivedObjectLoader<SourcePackage, Package::Loader>, public FeatureConditional
index 98d299026bc366aed45ab21568530b02e82b84f2..aa26411790227a3bc7659beccb495951b9b5bd56 100644 (file)
@@ -2,6 +2,7 @@
 #define STATICLIBRARY_H_
 
 #include "filetarget.h"
+#include "libbuilder_api.h"
 
 class Component;
 class ObjectFile;
@@ -9,7 +10,7 @@ class ObjectFile;
 /**
 A static library target.
 */
-class StaticLibrary: public FileTarget
+class LIBBUILDER_API StaticLibrary: public FileTarget
 {
 private:
        /* TODO this really belongs in a Component, but some refactoring is required
index 95867b70fcfb1b21cdca897bef91633a40bdcf53..b9b35e905b31d23bc391735191414af37585585e 100644 (file)
@@ -62,7 +62,7 @@ FS::Path get_program_files_x86_dir()
 }
 
 template<>
-string get_registry_value<string>(const string &path)
+LIBBUILDER_API string get_registry_value<string>(const string &path)
 {
 #ifdef _WIN32
        string::size_type first_sep = path.find('\\');
index 730086968b2e68bfe61ad4ebc762a4d2f78f96c7..789f5d44e5c47011f7e16229693d3236a3a98c33 100644 (file)
@@ -3,9 +3,10 @@
 
 #include <string>
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 
-std::string get_system_type();
-Msp::FS::Path get_program_files_x86_dir();
+LIBBUILDER_API std::string get_system_type();
+LIBBUILDER_API Msp::FS::Path get_program_files_x86_dir();
 
 template<typename T>
 T get_registry_value(const std::string &);
index 6ef6457a0f5fe73d70ddc31d7f66b561e878b63b..0ba38f82031b06122aa10c001f222e0bbf143c49 100644 (file)
@@ -7,6 +7,7 @@
 #include <vector>
 #include <sigc++/signal.h>
 #include <msp/time/timestamp.h>
+#include "libbuilder_api.h"
 
 class Builder;
 class BuildInfo;
@@ -24,7 +25,7 @@ normal and transitive.  Normal dependencies will need to be built before the
 target itself, and will cause the target to be rebuilt if modified.  Transitive
 dependencies can be used by other targets further down the chain.
 */
-class Target
+class LIBBUILDER_API Target
 {
 public:
        using Dependencies = std::vector<Target *>;
index 915ffe12a9e774f27adc9caede2736b59779492e..b0f56f470399446d7339b1508300c2f0fd89e59f 100644 (file)
@@ -4,13 +4,14 @@
 #include <string>
 #include <sigc++/signal.h>
 #include <msp/fs/path.h>
+#include "libbuilder_api.h"
 
 /**
 Tasks are used to manage other programs and worker threads involved in the
 build process.  They are run asynchronously by default, but a wait() method is
 provided should it be necessary to wait for a task to finish.
 */
-class Task
+class LIBBUILDER_API Task
 {
 public:
        enum Status
index 091202590e65effa6d257a56f06a24a0baf7a74b..a67e0bf7f9f6a0b8dc8487bc7dcab5a96f0c375c 100644 (file)
@@ -1,12 +1,13 @@
 #ifndef TEMPLATEFILE_H_
 #define TEMPLATEFILE_H_
 
+#include "libbuilder_api.h"
 #include "sourcefile.h"
 
 /**
 Input file for SourceGenerator.
 */
-class TemplateFile: public SourceFile
+class LIBBUILDER_API TemplateFile: public SourceFile
 {
 public:
        TemplateFile(Builder &b, const Component &c, const Msp::FS::Path &p): SourceFile(b, c, p) { }
index a6bd322a762b0bce5ccc609990870efe1c78a030..5921c2ddb2eb44e545711878d5c0401ded919343 100644 (file)
@@ -8,6 +8,7 @@
 #include "buildinfo.h"
 #include "externaltask.h"
 #include "internaltask.h"
+#include "libbuilder_api.h"
 #include "sourcepackage.h"
 #include "target.h"
 #include "virtualfilesystem.h"
@@ -31,7 +32,7 @@ public:
 Base class for tools.  Tools are used to turn targets into other targets.
 Examples include compilers and linkers.
 */
-class Tool: protected ToolData
+class LIBBUILDER_API Tool: protected ToolData
 {
 public:
        enum ProcessingUnit
index 34fc0a2b6651a77eda77c44c97c4679edd8057db..b3738c61ba530fd5d3da396b1609fe77d2dcffde 100644 (file)
@@ -4,13 +4,14 @@
 #include <map>
 #include <string>
 #include <vector>
+#include "libbuilder_api.h"
 
 class Tool;
 
 /**
 A container for tools.  Performs lookup based on tag or filename extension.
 */
-class Toolchain
+class LIBBUILDER_API Toolchain
 {
 private:
        std::string name;
index 60e198ad3b2dcf866c2be8f67094e054edf146e9..1a1c9ef11dfb5eeeda370229cca544f9c7769461 100644 (file)
@@ -6,6 +6,7 @@
 #include <vector>
 #include <msp/fs/path.h>
 #include "buildinfo.h"
+#include "libbuilder_api.h"
 
 class Builder;
 class FileTarget;
@@ -17,7 +18,7 @@ Provides access to the filesystem in a way that takes known targets into
 account.  Thus, targets may be returned for files that do not exist yet if it's
 possible to build them.
 */
-class VirtualFileSystem
+class LIBBUILDER_API VirtualFileSystem
 {
 public:
        using SearchPath = std::vector<Msp::FS::Path>;
index 5151826df9a7bda482b9c1a5498828c09516d810..088c02cf9bd9e9a57fb0dc963d57b6f5a3771143 100644 (file)
@@ -1,12 +1,13 @@
 #ifndef VIRTUALTARGET_H_
 #define VIRTUALTARGET_H_
 
+#include "libbuilder_api.h"
 #include "target.h"
 
 /**
 A target that is not associated with any file.
 */
-class VirtualTarget: public Target
+class LIBBUILDER_API VirtualTarget: public Target
 {
 public:
        VirtualTarget(Builder &b, const std::string &n): Target(b, n) { }