]> git.tdb.fi Git - builder.git/commitdiff
Define a macro to indicate which component is being built
authorMikko Rasa <tdb@tdb.fi>
Mon, 2 Jan 2023 22:24:59 +0000 (00:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 2 Jan 2023 22:51:47 +0000 (00:51 +0200)
This can be used in libraries to export or import functions across a DLL
interface as appropriate.

source/lib/component.cpp

index b98556c20476c1a92e0096bd9256a54f741c2c01..2763909a441f5f7053997f1e4cb641505fee9106 100644 (file)
@@ -4,6 +4,7 @@
 #include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
 #include <msp/strings/format.h>
+#include <msp/strings/utils.h>
 #include "builder.h"
 #include "component.h"
 #include "sourcepackage.h"
@@ -26,6 +27,7 @@ void Component::prepare()
 void Component::create_build_info()
 {
        BuildInfo final_build_info;
+       final_build_info.defines[toupper(name)+"_BUILD"] = "1";
 
        const Package::Requirements &pkg_reqs = package.get_required_packages();
        Package::Requirements direct_reqs = requires;