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 Jul 16, 2024
1 parent d4a6828 commit 2a2772a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 16 deletions.
14 changes: 14 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,20 @@ if(MSVC)
endif()
endif()

if(BUILD_ELUNA)
set_property(TARGET game shared mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA CMANGOS CLASSIC)
if(BUILD_PLAYERBOTS)
set_property(TARGET playerbots APPEND PROPERTY COMPILE_DEFINITIONS BUILD_ELUNA CLASSIC)
endif()
endif()

if(BUILD_SOLOCRAFT)
set_property(TARGET game mangosd APPEND PROPERTY COMPILE_DEFINITIONS BUILD_SOLOCRAFT)
if(BUILD_PLAYERBOTS)
set_property(TARGET playerbots APPEND PROPERTY COMPILE_DEFINITIONS BUILD_SOLOCRAFT)
endif()
endif()

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

if(BUILD_SOLOCRAFT)
add_definitions(-DBUILD_SOLOCRAFT)
endif()

if(NOT BUILD_DEPRECATED_PLAYERBOT)
Expand Down
6 changes: 0 additions & 6 deletions src/mangosd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -162,16 +162,10 @@ if (BUILD_ELUNA)
include_directories(
${CMAKE_SOURCE_DIR}/src/game/LuaEngine/hooks
)
add_definitions(-DBUILD_ELUNA -DCLASSIC -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()

# Define BUILD_SOLOCRAFT if needed
if (BUILD_SOLOCRAFT)
add_definitions(-DBUILD_SOLOCRAFT)
endif()

if(MSVC)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/\${BUILD_TYPE}/${EXECUTABLE_NAME}.pdb DESTINATION ${BIN_DIR} CONFIGURATIONS Debug)
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 @@ -271,11 +271,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 -DCLASSIC -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 2a2772a

Please sign in to comment.