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

Fix compilation of downstream bindings that include yarp.i #3148

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,16 @@ mark_as_advanced(SWIG_EXTRA_FLAGS)
if(YARP_COMPILE_BINDINGS)
unset(SWIG_COMMON_FLAGS)

#############################################################################
## Pass a macro to permit to code in yarp.i to distinguish between when is
## swig is processing yarp.i because it is generated yarp bindings, or if
## it is processing yarp.i as it was included in some downstream bindings
## (such as icub-main bindings)
## If you mantain a project downstream of YARP that is including yarp.i,
## make sure that you DO NOT define this macro
list(APPEND SWIG_COMMON_FLAGS "-DSWIG_GENERATING_YARP_BINDINGS")


#############################################################################
## Do not build deprecated functions when disabled

Expand Down
5 changes: 3 additions & 2 deletions bindings/yarp.i
Original file line number Diff line number Diff line change
Expand Up @@ -2005,10 +2005,11 @@ public:
}

//////////////////////////////////////////////////////////////////////////
// Just in Python add some code to automatically call
// Just in Python (and in yarp bindings itself, not in downstream bindings
// that include yarp.i) add some code to automatically call
// add_dll_directory as necessary
// See https://github.com/robotology/robotology-superbuild/issues/1268
// for more details
#ifdef SWIGPYTHON
#if defined(SWIGPYTHON) && defined(SWIG_GENERATING_YARP_BINDINGS)
%include <swig_python_windows_preable.i>
#endif
Loading