Skip to content

Commit

Permalink
Move custom additions defines to global space for use by other libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Niam5 committed Aug 8, 2024
1 parent 122ca26 commit 8893eb6
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 21 deletions.
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@ if(MSVC)
endif()
endif()

if(BUILD_ELUNA)
set_property(TARGET game shared mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA ELUNA_CMANGOS ELUNA_EXPANSION=3)
set_property(TARGET game mangosd APPEND PROPERTY INCLUDE_DIRECTORIES ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks)
set_property(TARGET game APPEND PROPERTY INCLUDE_DIRECTORIES
${CMAKE_SOURCE_DIR}/src/game/LuaEngine/
${CMAKE_SOURCE_DIR}/src/game/LuaEngine/methods/CMangos
${CMAKE_SOURCE_DIR}/dep/lualib
)
set_property(TARGET game APPEND PROPERTY LINK_LIBRARIES ${LIBRARY_NAME} PRIVATE lualib)
set_property(TARGET mangosd APPEND PROPERTY LINK_LIBRARIES ${EXECUTABLE_NAME} lualib)
if(BUILD_PLAYERBOTS)
set_property(TARGET playerbots APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA ELUNA_CMANGOS ELUNA_EXPANSION=3)
endif()
endif()

# if(SQL)
# add_subdirectory(sql)
# endif()
11 changes: 0 additions & 11 deletions src/game/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ foreach (TMP_PATH ${LIBRARY_SRCS})
list(REMOVE_ITEM LIBRARY_SRCS ${TMP_PATH})
endif ()
endforeach()
add_definitions(-DBUILD_ELUNA -DCMANGOS -DCATA)
endif()

if(NOT BUILD_DEPRECATED_PLAYERBOT)
Expand Down Expand Up @@ -118,7 +117,6 @@ target_link_libraries(${LIBRARY_NAME}
PRIVATE g3dlite
PRIVATE detour
PRIVATE zlib
PRIVATE lualib
)

# include additionals headers
Expand All @@ -129,10 +127,6 @@ set(ADDITIONAL_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/BattleGround
${CMAKE_CURRENT_SOURCE_DIR}/OutdoorPvP
${CMAKE_CURRENT_SOURCE_DIR}/PlayerBot
${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/
${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/methods/CMangos
${CMAKE_CURRENT_SOURCE_DIR}/LuaEngine/hooks
${CMAKE_SOURCE_DIR}/dep/lualib
${CMAKE_BINARY_DIR}
)

Expand All @@ -154,11 +148,6 @@ if (BUILD_SCRIPTDEV)
add_definitions(-DBUILD_SCRIPTDEV)
endif()

# Define BUILD_ELUNA if need
if (BUILD_ELUNA)
add_definitions(-DBUILD_ELUNA)
endif()

# Define BUILD_AHBOT if need
if (BUILD_AHBOT)
add_definitions(-DBUILD_AHBOT)
Expand Down
5 changes: 0 additions & 5 deletions src/mangosd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ target_link_libraries(${EXECUTABLE_NAME}
shared
game
gsoap
lualib
)

if(WIN32)
Expand Down Expand Up @@ -143,10 +142,6 @@ endif()

# Define BUILD_ELUNA if needed
if (BUILD_ELUNA)
include_directories(
${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks
)
add_definitions(-DBUILD_ELUNA -DCATA -DCMANGOS)
install(FILES ${CMAKE_SOURCE_DIR}/contrib/lua_scripts/masterscript.lua DESTINATION ${BIN_DIR}/lua_scripts)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/src/game/LuaEngine/extensions DESTINATION ${BIN_DIR}/lua_scripts)
endif()
Expand Down
5 changes: 0 additions & 5 deletions src/shared/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,6 @@ if(PCH)
target_precompile_headers(${LIBRARY_NAME} PRIVATE "${PCH_FILE_HEADER}")
endif()

# Define BUILD_ELUNA if needed
if (BUILD_ELUNA)
add_definitions(-DBUILD_ELUNA -DCATA -DCMANGOS)
endif()

# Mark the revision header as being generated.
set_source_files_properties(${CMAKE_BINARY_DIR}/src/shared/revision.h
PROPERTIES GENERATED TRUE
Expand Down

0 comments on commit 8893eb6

Please sign in to comment.