mirror of
https://github.com/tribufu/tribufu-java
synced 2026-05-18 09:35:44 +00:00
parent
717d3d00ef
commit
6f9a2fb7bd
4 changed files with 102 additions and 0 deletions
11
Native/Source/Library.c
Normal file
11
Native/Source/Library.c
Normal file
|
|
@ -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;
|
||||||
|
}
|
||||||
19
Native/Source/Library.h
Normal file
19
Native/Source/Library.h
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
// Copyright (c) TribuFu. All Rights Reserved
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "TribuFu.h"
|
||||||
|
|
||||||
|
#if defined(_MSC_VER)
|
||||||
|
#define EXPORT __declspec(dllexport)
|
||||||
|
#define IMPORT __declspec(dllimport)
|
||||||
|
#elif defined(__GNUC__)
|
||||||
|
#define EXPORT __attribute__((visibility("default")))
|
||||||
|
#define IMPORT
|
||||||
|
#else
|
||||||
|
#define EXPORT
|
||||||
|
#define IMPORT
|
||||||
|
#pragma warning Unknown dynamic link import/export semantics.
|
||||||
|
#endif
|
||||||
|
|
||||||
|
EXPORT char *Java_Hello(char *input);
|
||||||
62
Native/premake5.lua
Normal file
62
Native/premake5.lua
Normal file
|
|
@ -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"
|
||||||
|
}
|
||||||
10
premake5.lua
Normal file
10
premake5.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
workspace "DevKit.Jvm"
|
||||||
|
architecture "x64"
|
||||||
|
|
||||||
|
configurations
|
||||||
|
{
|
||||||
|
"debug",
|
||||||
|
"release"
|
||||||
|
}
|
||||||
|
|
||||||
|
include "Native"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue