Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Helper] XCode: run in Debug (and load debug plugins) #5168

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

fredroy
Copy link
Contributor

@fredroy fredroy commented Dec 16, 2024

Based on

Problem: Using XCode, it was impossible to load plugins with runSofa, when the config is "Debug" (i.e plugins are suffixed with _d), which is problematic if you want to try to debug in Debug configuration.


It appeared that the cmake statement adding the suffix

set_property(SOURCE ${SRC_ROOT}/system/PluginManager.cpp APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG "SOFA_LIBSUFFIX=_d" )

seems to not do anything with XCode.
Moreover, this cmake line is deprecated https://cmake.org/cmake/help/latest/policy/CMP0043.html
And its modern replacement

set_property(SOURCE ${SRC_ROOT}/system/PluginManager.cpp APPEND PROPERTY
 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:SOFA_LIBSUFFIX=_d>
)

is NOT COMPATIBLE with XCode:

CMake Error in Sofa/framework/Helper/CMakeLists.txt:
  Xcode does not support per-config per-source COMPILE_DEFINITIONS:

    $<$<CONFIG:Debug>:SOFA_LIBSUFFIX=_d>

  specified for source:

    blabla/sofa/src/current/Sofa/framework/Helper/src/sofa/helper/system/PluginManager.cpp

So it means that XCode was never able to add a compile_definition for a single file.

So this PR set the suffix using the new macro which detects the configuration (from #5133)


Note: doing this PR made me realize that it is not possible currently:

  • to load a debug plugin with runSofa(more precisely Sofa.Helper) compiled in not debug
  • and vice versa (loading a non-debug plugin with a debug runSofa)

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently labels Dec 16, 2024
@fredroy fredroy added this to the v25.06 milestone Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: based on previous PR PR based on a previous PR, therefore to be merged ONLY subsequently pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant