diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-05-07 10:44:56 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-05-07 11:25:24 +0200 |
commit | 3f5377d6810de412c8963414f66f472fc740cad9 (patch) | |
tree | 042266942978c672ae879f8964772ed524d29880 /src | |
parent | afbfb8b5792fb1e8b8bf5777576680f1a4f0cd08 (diff) | |
download | mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.gz mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.bz2 mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.xz mana-3f5377d6810de412c8963414f66f472fc740cad9.zip |
Replaced ENet with submodule
This also updates ENet from 1.3.2 to 1.3.18.
The previously supported WITH_BUNDLEDHEADERS option that affected which
ENet was being used has now been reversed and renamed to
USE_SYSTEM_ENET, which defaults to OFF for now.
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1d330112..f993f4ed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -34,9 +34,15 @@ elseif(NOT APPLE) endif() if(ENABLE_MANASERV) - include_directories("../libs/enet/include") - link_directories("../libs/enet") - set(ENET_LIBRARY enet) + if(NOT USE_SYSTEM_ENET) + message(STATUS "Using ENet submodule") + set(ENET_INCLUDE_DIR "../libs/enet/include") + set(ENET_LIBRARIES enet) + link_directories("../libs/enet") + else() + message(STATUS "Using system ENet") + find_package(ENet REQUIRED) + endif() add_compile_definitions(MANASERV_SUPPORT=1) message(STATUS "Manaserv support enabled") @@ -71,6 +77,7 @@ include_directories( ${PHYSFS_INCLUDE_DIR} ${CURL_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR} + ${ENET_INCLUDE_DIR} ${GUICHAN_INCLUDE_DIR} ${Intl_INCLUDE_DIRS}) @@ -615,7 +622,7 @@ endif(ENABLE_MANASERV) target_link_libraries( mana - PRIVATE ${ENET_LIBRARY} + PRIVATE ${ENET_LIBRARIES} ${SDL2_LINK_LIBRARIES} ${PNG_LIBRARIES} ${PHYSFS_LIBRARY} @@ -642,10 +649,6 @@ install( BUNDLE DESTINATION . RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -if(WIN32) - target_link_libraries(mana PRIVATE ws2_32 winmm) -endif() - if(APPLE) target_link_libraries(mana PRIVATE "-framework Foundation") set_target_properties(mana PROPERTIES OUTPUT_NAME Mana) |