Skip to content

Adjust Cmake options#3261

Open
Stoabrogga wants to merge 2 commits intovmangos:developmentfrom
Stoabrogga:cmake_options
Open

Adjust Cmake options#3261
Stoabrogga wants to merge 2 commits intovmangos:developmentfrom
Stoabrogga:cmake_options

Conversation

@Stoabrogga
Copy link
Contributor

🍰 Pullrequest

@0blu proposed these changes:

  • Rename USE_EXTRACTORS to BUILD_EXTRACTORS
  • Rename USE_REALMMERGE to BUILD_REALMMERGE
  • Remove reference to USE_STD_MALLOC which is not used anymore (TBB was removed in commit 28818aa)

The old options USE_EXTRACTORS and USE_REALMMERGE still work, but a Cmake warning is triggered if they are used.

Proof

None

Issues

None

How2Test

I used Cmake 3.31.6 on Debian 13:

  • Preparation:
    mkdir ~/vmangos/build
    cd ~/vmangos/build
  • Build with USE_EXTRACTORS/USE_REALMMERGE and BUILD_EXTRACTORS/BUILD_REALMMERGE:
    cmake ~/vmangos/core -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DUSE_EXTRACTORS=ON -DUSE_REALMMERGE=ON -DCMAKE_INSTALL_PREFIX=~/vmangos-srv -DCMAKE_BUILD_TYPE=Release
    cmake ~/vmangos/core -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DBUILD_EXTRACTORS=ON -DBUILD_REALMMERGE=ON -DCMAKE_INSTALL_PREFIX=~/vmangos-srv -DCMAKE_BUILD_TYPE=Release
    

Todo / Checklist

None

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the build configuration interface by renaming the extractor/realm-merge CMake options and removing obsolete TBB/USE_STD_MALLOC remnants, while keeping the old option names working with deprecation warnings.

Changes:

  • Rename USE_EXTRACTORS/USE_REALMMERGE to BUILD_EXTRACTORS/BUILD_REALMMERGE and add deprecation warnings for the old names.
  • Remove leftover USE_STD_MALLOC/TBB include/link blocks from several CMakeLists.
  • Update CI/docker build invocations and build option reporting to use the new option names.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
cmake/options.cmake Introduces BUILD_* options and deprecated-flag compatibility shims.
cmake/showoptions.cmake Displays the new build toggles in the configure summary.
CMakeLists.txt Switches contrib inclusion condition to BUILD_* flags.
dep/CMakeLists.txt Uses BUILD_EXTRACTORS to decide whether to build libmpq.
contrib/CMakeLists.txt Gates extractor/tools subdirectories on BUILD_* flags.
contrib/docker-build/buildServer.sh Uses -DBUILD_EXTRACTORS=1 in the container build.
.github/workflows/vmangos.yml CI uses -DBUILD_EXTRACTORS=1 instead of the old flag.
.github/workflows/dev-release.yml Windows release workflow uses -DBUILD_EXTRACTORS=1.
src/framework/CMakeLists.txt Removes obsolete commented TBB include + conditional TBB link/include block.
src/game/CMakeLists.txt Removes conditional TBB include block.
src/scripts/CMakeLists.txt Removes conditional TBB include block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the build configuration to use clearer CMake option names for optional tooling, while removing leftover (now-unused) build logic related to the old TBB/std-malloc switch.

Changes:

  • Rename USE_EXTRACTORSBUILD_EXTRACTORS and USE_REALMMERGEBUILD_REALMMERGE (with deprecation warnings for old flags).
  • Remove remaining USE_STD_MALLOC/TBB include/link blocks from core libraries’ CMakeLists.
  • Update CI/docker scripts and option display output to the new CMake flags.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/scripts/CMakeLists.txt Removes old TBB include-dir logic guarded by USE_STD_MALLOC.
src/game/CMakeLists.txt Removes old TBB include-dir logic guarded by USE_STD_MALLOC.
src/framework/CMakeLists.txt Removes commented TBB include + conditional include/link block.
dep/CMakeLists.txt Switches extractor dependency build gating to BUILD_EXTRACTORS.
contrib/docker-build/buildServer.sh Updates docker build invocation to -DBUILD_EXTRACTORS=1.
contrib/CMakeLists.txt Gates contrib tool subdirs on BUILD_EXTRACTORS / BUILD_REALMMERGE.
cmake/showoptions.cmake Prints new options (BUILD_EXTRACTORS, BUILD_REALMMERGE) in configure output.
cmake/options.cmake Defines new options and adds deprecated-option shims/warnings.
CMakeLists.txt Uses new options to decide whether to add the contrib subtree.
.github/workflows/vmangos.yml Updates CI CMake invocations to -DBUILD_EXTRACTORS=1.
.github/workflows/dev-release.yml Updates release workflow CMake invocation to -DBUILD_EXTRACTORS=1.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@0blu
Copy link
Collaborator

0blu commented Mar 15, 2026

wow Copilot changed its own suggestion.

@Stoabrogga
Copy link
Contributor Author

Yeah, it has new context, don't know if it's aware of its own review above. Nevertheless, I think the FORCE is ok here. I don't think someone turns on "USE_EXTRACTORS" and then tries to turn off "BUILD_EXTRACTORS" using the same build.

@0blu
Copy link
Collaborator

0blu commented Mar 16, 2026

Yeah, I've tested your changes with CMake GUI and their seem to work.
I don't think we need to handle the case where someone disables the BUILD_* after it was enabled.

This option is meant as a fallback.
We might need to change this to a FATAL_ERROR in a few month/years, so that cmake configuration fails if those deprecated flags are still used then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants