Fast-DDS-python icon indicating copy to clipboard operation
Fast-DDS-python copied to clipboard

[#23543] Set CMAKE_SHARED_LIBRARY_SUFFIX to always create .so files. (backport #207)

Open mergify[bot] opened this issue 2 months ago • 1 comments

Description

Currently, the way that CMake creates the library files always generates .dylib files on Mac. Compilation will work fine, but attempting to import in any Python app will cause the import to fail, as the interpreter expects .so files for library files. For some reason, using the flag --cmake-args " -DCMAKE_SHARED_LIBRARY_SUFFIX=.so" does not fix the issue. Additionally, setting the variable before the project() line in the CMakeLists also remains inneffective. So, the workaround is to add set(CMAKE_SHARED_LIBRARY_SUFFIX .so)
right after the project() line.

@Mergifyio backport 2.3.x 2.2.x 1.4.x

Fixes #206

Contributor Checklist

  • [x] Commit messages follow the project guidelines.
  • N/A: Tests that thoroughly check the new feature have been added/Regression tests checking the bug and its fix have been added; the added tests pass locally
  • [x] Changes are API compatible.
  • [x] Applicable backports have been included in the description.

Reviewer Checklist

  • [x] The PR has a milestone assigned.
  • [X] The title and description correctly express the PR's purpose.
  • [x] Check contributor checklist is correct.
  • [x] Check CI results: changes do not issue any warning.
  • [x] Check CI results: failing tests are unrelated with the changes.

This is an automatic backport of pull request #207 done by [Mergify](https://mergify.com).

mergify[bot] avatar Sep 25 '25 08:09 mergify[bot]

Cherry-pick of 57a5541adddf9af6d4338872bba559d8f760e111 has failed:

On branch mergify/bp/1.4.x/pr-207
Your branch is up to date with 'origin/1.4.x'.

You are currently cherry-picking commit 57a5541.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   fastdds_python/CMakeLists.txt
	modified:   fastdds_python/test/types/CMakeLists.txt
	modified:   fastdds_python_examples/HelloWorldExample/CMakeLists.txt

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   fastdds_python/test/types/test_complete.i
	both modified:   fastdds_python/test/types/test_modules.i
	deleted by us:   fastdds_python_examples/RPCExample/generated_code/CMakeLists.txt

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

mergify[bot] avatar Sep 25 '25 08:09 mergify[bot]