Skip to content

build(cmake): fix target name for RS_JEREMY_RIFKIN_CPPTRACE definition - #384

Open
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/cmake-cpptrace-target-name
Open

build(cmake): fix target name for RS_JEREMY_RIFKIN_CPPTRACE definition#384
jolavillette wants to merge 1 commit into
RetroShare:masterfrom
jolavillette:fix/cmake-cpptrace-target-name

Conversation

@jolavillette

Copy link
Copy Markdown
Contributor

When building with -DRS_CPPTRACE_STACKTRACE=ON, target_compile_definitions() referenced ${LIBRARY_NAME}, which is undefined in this scope.

As a result:

  • CMake evaluated the target name to empty, so -DRS_JEREMY_RIFKIN_CPPTRACE was never passed to the compiler.
  • rsstacktrace.cc silently ignored cpptrace (even though the library was fetched and linked).
  • On Windows and macOS, stack traces remained disabled ("Not implemented yet for this platform"), while Linux fell back to the basic glibc implementation without file/line resolution.

Fix by using ${PROJECT_NAME} (matching target_link_libraries on the previous line).

When RS_CPPTRACE_STACKTRACE is enabled, target_compile_definitions referenced ${LIBRARY_NAME}, which is undefined in this scope. Consequently, RS_JEREMY_RIFKIN_CPPTRACE was never passed to the compiler and rsstacktrace.cc could never use cpptrace.

Target should be ${PROJECT_NAME} (retroshare), matching target_link_libraries on the preceding line.
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.

1 participant