summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2016-09-23 21:18:58 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2016-09-24 14:03:55 +0100
commitc4e004a23da0bab19f379a097773989be858f543 (patch)
tree473d692d24e81f978623738401d45504fc2dbdfb
parentExport and explicitly instantiate templated model parts (diff)
downloadslicer-c4e004a23da0bab19f379a097773989be858f543.tar.bz2
slicer-c4e004a23da0bab19f379a097773989be858f543.tar.xz
slicer-c4e004a23da0bab19f379a097773989be858f543.zip
Support model metadata includes (allows including a header after ICE header has been processed, whereas ICE includes it before)
-rw-r--r--slicer/test/conversions.cpp1
-rw-r--r--slicer/test/types.ice2
-rw-r--r--slicer/tool/parser.cpp8
3 files changed, 9 insertions, 2 deletions
diff --git a/slicer/test/conversions.cpp b/slicer/test/conversions.cpp
index aaad378..9f79f2e 100644
--- a/slicer/test/conversions.cpp
+++ b/slicer/test/conversions.cpp
@@ -1,5 +1,6 @@
#include "types.h"
#include <boost/numeric/conversion/cast.hpp>
+#include <visibility.h>
#define SHORT(x) boost::numeric_cast< ::Ice::Short , int64_t >(x)
diff --git a/slicer/test/types.ice b/slicer/test/types.ice
index 311d210..e7811d0 100644
--- a/slicer/test/types.ice
+++ b/slicer/test/types.ice
@@ -1,10 +1,10 @@
[["cpp:include:boost/date_time/posix_time/posix_time_types.hpp"]]
[["cpp:include:boost/date_time/posix_time/time_formatters.hpp"]]
[["cpp:include:boost/date_time/posix_time/time_parsers.hpp"]]
-[["cpp:include:conversions.h"]]
#include <included.ice>
+["slicer:include:conversions.h"]
module TestModule {
enum SomeNumbers {
One = 1, Ten = 10, FiftyFive = 55
diff --git a/slicer/tool/parser.cpp b/slicer/tool/parser.cpp
index ca190a5..56fe4cd 100644
--- a/slicer/tool/parser.cpp
+++ b/slicer/tool/parser.cpp
@@ -120,7 +120,13 @@ namespace Slicer {
fprintbf(cpp, "// Begin Slicer code\n\n");
fprintbf(cpp, "#include <%s>\n\n", fs::change_extension(topLevelFile.filename(), ".h").string());
fprintbf(cpp, "#include <%s>\n", (headerPrefix / "modelPartsTypes.impl.h").string());
- fprintbf(cpp, "#include <%s>\n\n", (headerPrefix / "common.h").string());
+ fprintbf(cpp, "#include <%s>\n", (headerPrefix / "common.h").string());
+ for (const auto & m : u->modules()) {
+ for (const auto & i : metaDataValues("slicer:include:", m->getMetaData())) {
+ fprintbf(cpp, "#include <%s>\n", i);
+ }
+ }
+ fprintbf(cpp, "\n");
fprintbf(cpp, "namespace Slicer {\n");
return true;
}