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

cmake: support OBJC/OBJCXX on MinGW-w64 #20028

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

MehdiChinoune
Copy link
Collaborator

No description provided.

@MehdiChinoune
Copy link
Collaborator Author

@qmfrederik
Copy link
Contributor

@MehdiChinoune Thanks!

With this patch, I get the following names:

  • libobjc.dll.a
  • libobjc.dll

I still need to set(CMAKE_OBJCXX_IMPLICIT_INCLUDE_DIRECTORIES ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) for compilation on clang64 to work.

@MehdiChinoune MehdiChinoune marked this pull request as ready for review February 12, 2024 21:13
@MehdiChinoune MehdiChinoune merged commit 05619c4 into msys2:master Feb 12, 2024
8 checks passed
@MehdiChinoune MehdiChinoune deleted the cmake-objc branch February 12, 2024 21:13
@MehdiChinoune
Copy link
Collaborator Author

OBJC/OBJCXX support still not completed. One shouldn't add any LDFLAGS for standard libraries. They should be added automatically by CMake. I don't have any knoweldge/experience with OBJC/OBJCXX, I'll let to someone else to do the job.

@qmfrederik
Copy link
Contributor

@MehdiChinoune The LDFLAGS do two things:

  1. Ensure Objective C files are linked with a C++ runtime (libobjc2 uses a c++ runtime for its exception support)
  2. Ensure lld is used as the linker (the only linker which works well with Objective C)

I'm not sure to what extent you could hardcode 2. in cmake, but I assume there should be a way to determine what the default C++ runtime is and link that with any OBJC application? I don't know the inner details of cmake well enough to submit patches for this, unfortunately.

qmfrederik added a commit to gnustep/libobjc2 that referenced this pull request Feb 13, 2024
We no longer need to manually set these suffixes/prefixes as CMake in MSYS2 now knows about Objective C.

See msys2/MINGW-packages#20028
See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9244
See msys2/MINGW-packages#20024 (comment)
qmfrederik added a commit to gnustep/libobjc2 that referenced this pull request Mar 21, 2024
We no longer need to manually set these suffixes/prefixes as CMake in MSYS2 now knows about Objective C.

See msys2/MINGW-packages#20028
See https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9244
See msys2/MINGW-packages#20024 (comment)
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.

None yet

2 participants