Skip to content

Commit f0d8491

Browse files
committed
Addendum to previous commit (Make Lua symbols visible)
1 parent 3ed9de4 commit f0d8491

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

vendor/lua/premake5.lua

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ project "Lua_Server"
1414
"src/**.h",
1515
}
1616

17+
defines { "LUA_BUILD_AS_DLL" }
18+
1719
filter "system:windows"
18-
defines { "LUA_BUILD_AS_DLL" }
1920
kind "SharedLib"
2021
targetdir(buildpath("server/mods/deathmatch"))
2122

@@ -46,12 +47,10 @@ if os.target() == "windows" then
4647
}
4748

4849
defines {
49-
"LUA_USE_APICHECK"
50+
"LUA_USE_APICHECK",
51+
"LUA_BUILD_AS_DLL"
5052
}
5153

52-
configuration "windows"
53-
defines { "LUA_BUILD_AS_DLL" }
54-
5554
filter "platforms:x64"
5655
flags { "ExcludeFromBuild" }
5756
end

vendor/lua/src/luaconf.h

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,21 @@
153153
*/
154154
#if defined(LUA_BUILD_AS_DLL)
155155

156-
#if defined(LUA_CORE) || defined(LUA_LIB)
157-
#define LUA_API __declspec(dllexport)
156+
#ifdef LUA_WIN
157+
#if defined(LUA_CORE) || defined(LUA_LIB)
158+
#define LUA_API __declspec(dllexport)
159+
#else
160+
#define LUA_API __declspec(dllimport)
161+
#endif
158162
#else
159-
#define LUA_API __declspec(dllimport)
163+
#if defined(LUA_CORE) || defined(LUA_LIB)
164+
#define LUA_API extern __attribute__((visibility("default")))
165+
#endif
160166
#endif
161167

162168
#else
163169

164-
#define LUA_API extern __attribute__((visibility("default")))
170+
#define LUA_API extern
165171

166172
#endif
167173

0 commit comments

Comments
 (0)