Updated Windows DLL build script to export all symbols
This commit is contained in:
@@ -76,6 +76,7 @@ endif ()
|
|||||||
|
|
||||||
# WINDOWS-specific MSVC flags and libraries
|
# WINDOWS-specific MSVC flags and libraries
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
set (LWIP_PORT_DIR ${PROJ_DIR}/ext/lwip-contrib/ports/win32)
|
||||||
# 32-bit
|
# 32-bit
|
||||||
if(NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
if(NOT "${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
||||||
set (WINLIBDIR, "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.16299.0/um/x86")
|
set (WINLIBDIR, "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.16299.0/um/x86")
|
||||||
@@ -84,16 +85,15 @@ endif ()
|
|||||||
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
if("${CMAKE_GENERATOR}" MATCHES "(Win64|IA64)")
|
||||||
set (WINLIBDIR, "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.16299.0/um/x64")
|
set (WINLIBDIR, "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.16299.0/um/x64")
|
||||||
endif ()
|
endif ()
|
||||||
message (STATUS ${WINLIBDIR})
|
|
||||||
find_library (ws2_32_LIBRARY_PATH NAMES WS2_32 HINTS ${WINLIBDIR})
|
find_library (ws2_32_LIBRARY_PATH NAMES WS2_32 HINTS ${WINLIBDIR})
|
||||||
find_library (shlwapi_LIBRARY_PATH NAMES ShLwApi HINTS ${WINLIBDIR})
|
find_library (shlwapi_LIBRARY_PATH NAMES ShLwApi HINTS ${WINLIBDIR})
|
||||||
#find_library (iphlpapi_LIBRARY_PATH NAMES iphlpapi HINTS ${WINLIBDIR})
|
|
||||||
set (iphlpapi_LIBRARY_PATH "${WINLIBDIR}/iphlpapi.Lib")
|
set (iphlpapi_LIBRARY_PATH "${WINLIBDIR}/iphlpapi.Lib")
|
||||||
|
message (STATUS ${WINLIBDIR})
|
||||||
message (STATUS "WS2_32=${ws2_32_LIBRARY_PATH}")
|
message (STATUS "WS2_32=${ws2_32_LIBRARY_PATH}")
|
||||||
message (STATUS "ShLwApi=${shlwapi_LIBRARY_PATH}")
|
message (STATUS "ShLwApi=${shlwapi_LIBRARY_PATH}")
|
||||||
message (STATUS "liphlpapi=${iphlpapi_LIBRARY_PATH}")
|
message (STATUS "liphlpapi=${iphlpapi_LIBRARY_PATH}")
|
||||||
add_definitions (-DZT_SDK=1)
|
add_definitions (-DZT_SDK=1)
|
||||||
set (LWIP_PORT_DIR ${PROJ_DIR}/ext/lwip-contrib/ports/win32)
|
add_definitions (-DADD_EXPORTS=1)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
# --- JNI
|
# --- JNI
|
||||||
@@ -115,21 +115,25 @@ endif ()
|
|||||||
|
|
||||||
# --- BUILD TARGETS (FINAL PRODUCT)
|
# --- BUILD TARGETS (FINAL PRODUCT)
|
||||||
|
|
||||||
# libzt (static)
|
# libzt
|
||||||
set (LIBZT_SRC_DIR ${PROJ_DIR}/src)
|
set (LIBZT_SRC_DIR ${PROJ_DIR}/src)
|
||||||
include_directories ("${LIBZT_SRC_DIR}")
|
include_directories ("${LIBZT_SRC_DIR}")
|
||||||
include_directories ("${PROJ_DIR}/include")
|
include_directories ("${PROJ_DIR}/include")
|
||||||
file (GLOB libzt_src_glob ${LIBZT_SRC_DIR}/*.cpp)
|
file (GLOB libzt_src_glob ${LIBZT_SRC_DIR}/*.cpp)
|
||||||
|
|
||||||
|
# (static)
|
||||||
add_library (zt-static STATIC
|
add_library (zt-static STATIC
|
||||||
$<TARGET_OBJECTS:lwip_obj>
|
$<TARGET_OBJECTS:lwip_obj>
|
||||||
$<TARGET_OBJECTS:zto_obj>
|
$<TARGET_OBJECTS:zto_obj>
|
||||||
$<TARGET_OBJECTS:http_obj> ${libzt_src_glob})
|
$<TARGET_OBJECTS:http_obj> ${libzt_src_glob})
|
||||||
set_target_properties (zt-static PROPERTIES OUTPUT_NAME zt-static)
|
set_target_properties (zt-static PROPERTIES OUTPUT_NAME zt-static)
|
||||||
|
|
||||||
# libzt (shared)
|
# (shared)
|
||||||
add_library (zt-shared SHARED ${libzt_src_glob})
|
add_library (zt-shared SHARED ${libzt_src_glob})
|
||||||
|
message (STATUS ${libzt_src_glob})
|
||||||
target_link_libraries (zt-shared lwip_pic zto_pic http_pic)
|
target_link_libraries (zt-shared lwip_pic zto_pic http_pic)
|
||||||
set_target_properties (zt-shared PROPERTIES OUTPUT_NAME zt-shared)
|
set_target_properties (zt-shared PROPERTIES OUTPUT_NAME zt-shared)
|
||||||
|
set_target_properties (zt-shared PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS true)
|
||||||
|
|
||||||
if (${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
if (${CMAKE_SYSTEM_NAME} MATCHES "Android")
|
||||||
target_link_libraries (zt-shared android log)
|
target_link_libraries (zt-shared android log)
|
||||||
|
|||||||
Reference in New Issue
Block a user