Skip to content

Commit 9829e3f

Browse files
committed
Export luaopen_https
And hide other symbols everywhere (well.. when using gcc or clang)
1 parent 711ab48 commit 9829e3f

4 files changed

Lines changed: 12 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cmake_minimum_required (VERSION 2.6)
22

3-
project (Https)
3+
project (Https CXX)
44

55
add_subdirectory (src)

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ include_directories (
99
${CMAKE_CURRENT_BINARY_DIR}
1010
)
1111

12+
### Compiler-specific flags
13+
if (${CMAKE_CXX_COMPILER_ID} MATCHES "MSVC")
14+
set (DLLEXPORT "__declspec(dllexport)")
15+
elseif (${CMAKE_CXX_COMPILER_ID} MATCHES "GNU" OR ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
16+
set (DLLEXPORT "__attribute__((visibility(\"default\")))")
17+
add_compile_options ("-fvisibility=hidden")
18+
add_link_options ("-fvisibility=hidden")
19+
endif ()
20+
1221
### "Libraries"
1322
add_library (https MODULE
1423
lua/main.cpp

src/common/config.h.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
#cmakedefine USE_SCHANNEL_BACKEND
44
#cmakedefine USE_NSURL_BACKEND
55
#cmakedefine USE_WINSOCK
6+
#define DLLEXPORT @DLLEXPORT@

src/lua/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ static int w_request(lua_State *L)
168168
return advanced ? 3 : 2;
169169
}
170170

171-
extern "C" int luaopen_https(lua_State *L)
171+
extern "C" int DLLEXPORT luaopen_https(lua_State *L)
172172
{
173173
lua_newtable(L);
174174

0 commit comments

Comments
 (0)