Skip to content

Commit

Permalink
Replace submodule with fetchcontent (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidonete authored and celguar committed Mar 25, 2024
1 parent d8319af commit 049385b
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 53 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "src/modules/Bots"]
path = src/modules/Bots
url = https://github.com/celguar/mangosbot-bots.git
21 changes: 9 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -380,19 +380,16 @@ if(BUILD_PLAYERBOTS)
endif()
endif()

if(NOT BUILD_GAME_SERVER AND BUILD_IKE3_BOTS)
set(BUILD_IKE3_BOTS OFF)
message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set")
endif()

if(BUILD_IKE3_BOTS)
set(BUILD_PLAYERBOT OFF)
message(STATUS "CMaNGOS bots DISABLED because Ike3 bots enabled")
endif()
if(BUILD_PLAYERBOTS)
if(BUILD_DEPRECATED_PLAYERBOT)
set(BUILD_DEPRECATED_PLAYERBOT OFF)
message(STATUS "BUILD_DEPRECATED_PLAYERBOT forced to OFF because BUILD_PLAYERBOTS is set")
endif()

if(BUILD_PLAYERBOT)
set(BUILD_IKE3_BOTS OFF)
message(STATUS "Ike3 bots DISABLED because CMaNGOS bots enabled")
if(NOT BUILD_GAME_SERVER)
set(BUILD_PLAYERBOTS OFF)
message(STATUS "BUILD_PLAYERBOTS forced to OFF due to BUILD_GAME_SERVER is not set")
endif()
endif()

if(BUILD_MODULES AND NOT BUILD_GAME_SERVER)
Expand Down
2 changes: 1 addition & 1 deletion cmake/options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ option(BUILD_PLAYERBOTS "Build Playerbots mod"
option(BUILD_AHBOT "Build Auction House Bot mod" OFF)

# Modules
option(BUILD_MODULES "Build module system" OFF)
option(BUILD_MODULES "Build module system" OFF)
foreach(MODULE_NAME ${MODULE_NAMES})
if(NOT ${MODULE_NAME} STREQUAL "MODULES")
string(TOLOWER ${MODULE_NAME} LOWER_MODULE_NAME)
Expand Down
6 changes: 0 additions & 6 deletions cmake/showoptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ else()
message(STATUS "Build Playerbots : No (default)")
endif()

if(BUILD_IKE3_BOTS)
message(STATUS "Build ike3 Playerbots : Yes")
else()
message(STATUS "Build ike3 Playerbots : No (default)")
endif()

# Modules
if(BUILD_MODULES)
message(STATUS "Build Modules : Yes")
Expand Down
6 changes: 3 additions & 3 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ endif()

if(NOT BUILD_PLAYERBOTS)
# exclude Playerbots folder
set (EXCLUDE_DIR "Bots/")
set (EXCLUDE_DIR "PlayerBots/")
foreach (TMP_PATH ${LIBRARY_SRCS})
string (FIND ${TMP_PATH} ${EXCLUDE_DIR} EXCLUDE_DIR_FOUND)
if (NOT ${EXCLUDE_DIR_FOUND} EQUAL -1)
Expand Down Expand Up @@ -184,8 +184,8 @@ if (BUILD_PLAYERBOTS)
add_definitions(-DENABLE_PLAYERBOTS)
endif()

# Define Ike3 Bots ENABLE_PLAYERBOTS if need
if (BUILD_IKE3_BOTS)
# Define ENABLE_PLAYERBOTS if need
if (BUILD_PLAYERBOTS)
add_definitions(-DENABLE_PLAYERBOTS)
endif()

Expand Down
1 change: 0 additions & 1 deletion src/game/Entities/CharacterHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,6 @@ class CharacterHandler
session->HandlePlayerLogin((LoginQueryHolder*)holder);
#endif
}

#ifdef BUILD_DEPRECATED_PLAYERBOT
// This callback is different from the normal HandlePlayerLoginCallback in that it
// sets up the bot's world session and also stores the pointer to the bot player in the master's
Expand Down
1 change: 0 additions & 1 deletion src/game/Server/WorldSession.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ class WorldSession
const std::string GetRemoteAddress() const { return m_socket ? m_socket->GetRemoteAddress() : "disconnected/bot"; }
#else
const std::string GetRemoteAddress() const { return m_socket ? m_socket->GetRemoteAddress() : "disconnected"; }
#endif
#endif
const std::string& GetLocalAddress() const { return m_localAddress; }

Expand Down
6 changes: 5 additions & 1 deletion src/mangosd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,15 @@ if(WIN32)
add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/src/game/Anticheat/module/warden_modules/ $<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/warden_modules
DEPENDS ${EXECUTABLE_NAME})

if(BUILD_DEPRECATED_PLAYERBOT)
add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${CMAKE_SOURCE_DIR}/src/game/PlayerBot/playerbot.conf.dist.in\" \"$<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/playerbot.conf.dist\")
endif()

if(BUILD_PLAYERBOTS)
add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different \"${CMAKE_SOURCE_DIR}/src/modules/playerbots/playerbot/aiplayerbot.conf.dist.in\" \"$<TARGET_FILE_DIR:${EXECUTABLE_NAME}>/aiplayerbot.conf.dist\")
endif()

if(BUILD_PLAYERBOTS)
add_custom_command(TARGET ${EXECUTABLE_NAME} POST_BUILD
Expand Down
1 change: 0 additions & 1 deletion src/modules/Bots
Submodule Bots deleted from f1720e
24 changes: 0 additions & 24 deletions src/modules/CMakeLists.txt

This file was deleted.

0 comments on commit 049385b

Please sign in to comment.