mirror of
https://github.com/xenia-project/premake-core.git
synced 2024-10-07 00:53:28 +00:00
Move luasocket from being a static lib to a binary module
This commit is contained in:
parent
09dbeff23f
commit
51aae62dcb
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
15
binmodules/luasocket/main.c
Normal file
15
binmodules/luasocket/main.c
Normal file
@ -0,0 +1,15 @@
|
||||
#include <luashim.h>
|
||||
|
||||
int luaopen_socket_core(lua_State *L);
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport) int luaopen_luasocket(lua_State *L)
|
||||
#else
|
||||
int luaopen_luasocket(lua_State *L)
|
||||
#endif
|
||||
{
|
||||
shimInitialize(L);
|
||||
luaL_requiref(L, "socket", luaopen_socket_core, 1);
|
||||
lua_pop(L, 1);
|
||||
return 0;
|
||||
}
|
50
binmodules/luasocket/premake5.lua
Normal file
50
binmodules/luasocket/premake5.lua
Normal file
@ -0,0 +1,50 @@
|
||||
project "luasocket"
|
||||
language "C"
|
||||
kind "SharedLib"
|
||||
warnings "extra"
|
||||
|
||||
includedirs
|
||||
{
|
||||
"../../contrib/lua/src",
|
||||
"../../contrib/luashim"
|
||||
}
|
||||
|
||||
links { 'luashim-lib' }
|
||||
|
||||
files
|
||||
{
|
||||
"src/*.c",
|
||||
"src/*.h",
|
||||
"src/*.lua",
|
||||
"*.c"
|
||||
}
|
||||
|
||||
filter "system:windows"
|
||||
removefiles
|
||||
{
|
||||
"src/serial.c",
|
||||
"src/unixdgram.*",
|
||||
"src/unixstream.*",
|
||||
"src/unix.*",
|
||||
"src/usocket.*",
|
||||
}
|
||||
|
||||
links { 'ws2_32' }
|
||||
|
||||
defines { "LUASOCKET_API=__declspec(dllexport)" }
|
||||
|
||||
filter "system:not windows"
|
||||
removefiles
|
||||
{
|
||||
"src/wsocket.*",
|
||||
}
|
||||
|
||||
pic "on"
|
||||
|
||||
defines { "LUASOCKET_API=__attribute__((visibility(\"default\")))" }
|
||||
|
||||
filter "configurations:Release"
|
||||
targetdir "../../bin/release"
|
||||
|
||||
filter "configurations:Debug"
|
||||
targetdir "../../bin/debug"
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user