File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 2.6 )
22
3- project (Https)
3+ project (Https CXX )
44
55add_subdirectory (src )
Original file line number Diff line number Diff 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"
1322add_library (https MODULE
1423 lua/main.cpp
Original file line number Diff line number Diff line change 33#cmakedefine USE_SCHANNEL_BACKEND
44#cmakedefine USE_NSURL_BACKEND
55#cmakedefine USE_WINSOCK
6+ #define DLLEXPORT @DLLEXPORT@
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments