diff options
Diffstat (limited to 'libmhello/libmhello')
-rw-r--r-- | libmhello/libmhello/buildfile | 15 | ||||
-rw-r--r-- | libmhello/libmhello/hello.cxx | 20 | ||||
-rw-r--r-- | libmhello/libmhello/hello.mxx | 11 |
3 files changed, 46 insertions, 0 deletions
diff --git a/libmhello/libmhello/buildfile b/libmhello/libmhello/buildfile new file mode 100644 index 0000000..799e848 --- /dev/null +++ b/libmhello/libmhello/buildfile @@ -0,0 +1,15 @@ +import libs = libstd-modules%liba{std-modules} + +lib{mhello}: {mxx cxx}{hello} $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. +# +if $version.pre_release + lib{mhello}: bin.lib.version = @"-$version.project_id" +else + lib{mhello}: bin.lib.version = @"-$version.major.$version.minor" + +# Install into the libmhello/ subdirectory of, say, /usr/include/. +# +install.include = $install.include/$project/ diff --git a/libmhello/libmhello/hello.cxx b/libmhello/libmhello/hello.cxx new file mode 100644 index 0000000..ff01860 --- /dev/null +++ b/libmhello/libmhello/hello.cxx @@ -0,0 +1,20 @@ +// file: libmhello/hello.cxx -*- C++ -*- + +module hello; + +#ifdef __clang__ +import std.core; +#endif + +import std.io; + +using namespace std; + +namespace hello +{ + void + say (const string& n) + { + cout << "Hello, " << n << '!' << endl; + } +} diff --git a/libmhello/libmhello/hello.mxx b/libmhello/libmhello/hello.mxx new file mode 100644 index 0000000..56993b3 --- /dev/null +++ b/libmhello/libmhello/hello.mxx @@ -0,0 +1,11 @@ +// file: libmhello/hello.mxx -*- C++ -*- + +export module hello; + +import std.core; + +export namespace hello +{ + __symexport void + say (const std::string& name); +} |