Skip to content

Add build option "ENABLE_CPPTRACE"#3256

Open
Stoabrogga wants to merge 3 commits intovmangos:developmentfrom
Stoabrogga:cpptrace
Open

Add build option "ENABLE_CPPTRACE"#3256
Stoabrogga wants to merge 3 commits intovmangos:developmentfrom
Stoabrogga:cpptrace

Conversation

@Stoabrogga
Copy link
Contributor

@Stoabrogga Stoabrogga commented Mar 14, 2026

🍰 Pullrequest

Add build option "ENABLE_CPPTRACE". Default is "ON". If off, cpptrace is disabled. This can be useful if it is not needed, e.g. if gdb is used instead. Also speeds up the build process because cpptrace has a dependency to libdwarf which also needs zstd. Both are downloaded during the build process.

Proof

None

Issues

None

How2Test

I used Cmake 3.31.6 on Debian 13:

  • Preparation:
    mkdir ~/vmangos/build
    cd ~/vmangos/build
  • Build with default ("ENABLE_CPPTRACE" is "ON"):
    cmake ~/vmangos/core -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DUSE_PCH=OFF -DCMAKE_INSTALL_PREFIX=~/vmangos-srv -DCMAKE_BUILD_TYPE=Release
    make -j $(($(nproc)+2))
    
  • Turn off "ENABLE_CPPTRACE":
    cmake ~/vmangos/core -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DENABLE_CPPTRACE=OFF -DUSE_PCH=OFF -DCMAKE_INSTALL_PREFIX=~/vmangos-srv -DCMAKE_BUILD_TYPE=Release
    make -j $(($(nproc)+2))
    

Todo / Checklist

None

option(USE_EXTRACTORS "Build extractors" OFF)
option(USE_REALMMERGE "Build helper tool for merging character databases" OFF)
option(ENABLE_MAILSENDER "Enables support for sending emails via sendgrid.com (requires libcurl)" OFF)
option(DISABLE_STACK_TRACE "Disables cpptrace stack tracing if not needed (e.g. if GDB is used)" OFF)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe we should call it ENABLE_STACK_TRACE and make it ON by default.
Just to prevent double negation and metal overhead.

Copy link
Collaborator

@0blu 0blu Mar 14, 2026

Choose a reason for hiding this comment

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

Maybe ENABLE_RUNTIME_STACKTRACE (although a stack trace is usually runtime only)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Or ENABLE_CPPTRACE_STACKTRACE

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Or just ENABLE_CPPTRACE?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I now use ENABLE_CPPTRACE because it is shorter, hope that's ok.

@Stoabrogga Stoabrogga changed the title Add build option "DISABLE_STACK_TRACE" Add build option "ENABLE_CPPTRACE" Mar 14, 2026
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.

2 participants