Auto-update enet to v1.3.18 (#3913)
* Update enet to v1.3.18 * patch cmake --------- Co-authored-by: star-hengxing <hengxings783@gmail.com>pull/3925/head
parent
364404e28a
commit
33485fd906
3 changed files with 45 additions and 23 deletions
@ -0,0 +1,40 @@ |
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c6459b62..66d67884 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -84,19 +84,26 @@ set(SOURCE_FILES
|
||||
source_group(include FILES ${INCLUDE_FILES})
|
||||
source_group(source FILES ${SOURCE_FILES})
|
||||
|
||||
-add_library(enet STATIC
|
||||
+if(WIN32 AND BUILD_SHARED_LIBS AND (MSVC OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
|
||||
+ add_definitions(-DENET_DLL=1)
|
||||
+ add_definitions(-DENET_BUILDING_LIB)
|
||||
+endif()
|
||||
+
|
||||
+add_library(enet
|
||||
${INCLUDE_FILES}
|
||||
${SOURCE_FILES}
|
||||
)
|
||||
|
||||
-if (MINGW)
|
||||
+if (WIN32)
|
||||
target_link_libraries(enet winmm ws2_32)
|
||||
endif()
|
||||
|
||||
+include(GNUInstallDirs)
|
||||
install(TARGETS enet
|
||||
- RUNTIME DESTINATION bin
|
||||
- ARCHIVE DESTINATION lib/static
|
||||
- LIBRARY DESTINATION lib)
|
||||
-
|
||||
-install(DIRECTORY include/
|
||||
- DESTINATION include)
|
||||
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
+)
|
||||
+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/enet
|
||||
+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
+)
|
||||
\ No newline at end of file
|
Loading…
Reference in new issue