diff --git a/Native/Source/Library.c b/Native/Source/Library.c new file mode 100644 index 0000000..11a4fd6 --- /dev/null +++ b/Native/Source/Library.c @@ -0,0 +1,11 @@ +// Copyright (c) TribuFu. All Rights Reserved + +#include "Library.h" +#include "TribuFu.h" + +char *Java_Hello(char *input) +{ + char *result = Hello("C"); + + return result; +} diff --git a/Native/Source/Library.h b/Native/Source/Library.h new file mode 100644 index 0000000..ed8f6ce --- /dev/null +++ b/Native/Source/Library.h @@ -0,0 +1,7 @@ +// Copyright (c) TribuFu. All Rights Reserved + +#include "TribuFu.h" + +#define EXPORT __declspec(dllexport) + +EXPORT char *Java_Hello(char *input); diff --git a/Native/premake5.lua b/Native/premake5.lua new file mode 100644 index 0000000..583e200 --- /dev/null +++ b/Native/premake5.lua @@ -0,0 +1,62 @@ +project "TribuFu.Jvm" + location "." + kind "SharedLib" + language "C" + + targetdir ("./Binaries/%{cfg.buildcfg}") + objdir ("./Intermediate/") + + files + { + "./Source/**.h", + "./Source/**.c", + } + + includedirs + { + "../Vendor/TribuFu" + } + + filter "system:windows" + staticruntime "Off" + systemversion "latest" + + links + { + "TribuFu.lib" + } + + libdirs + { + "../Vendor/TribuFu/Windows" + } + + filter { "system:windows", "configurations:debug" } + runtime "Debug" + symbols "on" + + filter { "system:windows", "configurations:release" } + runtime "Release" + optimize "on" + + filter "system:linux" + links + { + "TribuFu" + } + + libdirs + { + "../Vendor/TribuFu/Linux" + } + + filter "system:darwin" + links + { + "TribuFu" + } + + libdirs + { + "../Vendor/TribuFu/Mac" + } diff --git a/premake5.lua b/premake5.lua new file mode 100644 index 0000000..b1fe65c --- /dev/null +++ b/premake5.lua @@ -0,0 +1,10 @@ +workspace "DevKit.Jvm" + architecture "x64" + + configurations + { + "debug", + "release" + } + + include "Native"