diff options
| -rw-r--r-- | xmake/templates/dlang/shared/project/src/interfaces.d | 14 | ||||
| -rw-r--r-- | xmake/templates/dlang/shared/project/xmake.lua | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/xmake/templates/dlang/shared/project/src/interfaces.d b/xmake/templates/dlang/shared/project/src/interfaces.d index 3386c9124..b4f7ab6ba 100644 --- a/xmake/templates/dlang/shared/project/src/interfaces.d +++ b/xmake/templates/dlang/shared/project/src/interfaces.d @@ -1,9 +1,15 @@ -extern(C) int add(int a, int b) -{ +version(Windows) { + import core.sys.windows.windows; + import core.sys.windows.dll; + mixin SimpleDllMain; +} + +extern(C) int add(int a, int b) { return a + b; } -extern(C) int sub(int a, int b) -{ +extern(C) int sub(int a, int b) { return a - b; } + + diff --git a/xmake/templates/dlang/shared/project/xmake.lua b/xmake/templates/dlang/shared/project/xmake.lua index 277b2e611..b9cc7cb8f 100644 --- a/xmake/templates/dlang/shared/project/xmake.lua +++ b/xmake/templates/dlang/shared/project/xmake.lua @@ -4,6 +4,9 @@ target("${TARGETNAME}") set_kind("shared") add_files("src/interfaces.d") add_includedirs("src", {public = true}) + add_rules("utils.symbols.export_list", {symbols = { + "add", + "sub"}}) target("${TARGETNAME}_demo") set_kind("binary") |
