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

[MesonToolchain] Added Objective-C/C++ arguments #11632

Merged
merged 2 commits into from Jul 14, 2022

Conversation

franramirez688
Copy link
Contributor

@franramirez688 franramirez688 commented Jul 13, 2022

Changelog: Feature: Added objc_args/objc_link_args/objcpp_args/objcpp_link_args to MesonToolchain for Objective-C/C++ language.
Closes: #11628
Docs: conan-io/docs#2652

@franramirez688
Copy link
Contributor Author

franramirez688 commented Jul 13, 2022

I want to add another test using Objective-C++ (typical hello.lib and demo app linking with it)

Copy link
Contributor

@SSE4 SSE4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is outstanding PR, it looks fantastic!

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good, though I wonder a bit about objectiveC support in general:

  • Shouldn't it be its own compiler? Are there packages mixed with C/C++ and objC? Only ObjC?
  • What happens with the binary model for objC?
  • What happens with other build systems like CMake for ObjC?

conan/tools/meson/toolchain.py Outdated Show resolved Hide resolved
@SSE4
Copy link
Contributor

SSE4 commented Jul 13, 2022

  • Shouldn't it be its own compiler?

in which context?
if you mean compiler executable, there are just clang and clang++. there are no dedicated executables to compile Objective-C[++] code. it's basically controlled by flags (e.g. -x objective-c)
if you mean compiler as a suite, it's part of LLVM/Clang package.
if you mean compiler as a conan setting, it is just apple-clang entry.

  • Are there packages mixed with C/C++ and objC? Only ObjC?

there are MANY packages mixing C/C++ with Objective-C/Objective-C++.
Objective-C[++] basically acts as a glue for al the modern Apple APIs - there is just no way to invoke these APIs from C/C++.

  • What happens with the binary model for objC?

it's basically follows pure C model more or less. we didn't need to complicate it in the past.

  • What happens with other build systems like CMake for ObjC?

CMake supports Objective-C[++] out of the box. other build systems (e.g. autotools) as well. probably some rare used might not support it, but it has nothing to do with conan.

@memsharded
Copy link
Member

Nice, thanks for the explanations, @SSE4, I think now it is a bit more clear, and can be moved forward.
Maybe just conditioning on the "apple" platform is enough @franramirez688, and it can be marked as ready for review

@franramirez688 franramirez688 marked this pull request as ready for review July 14, 2022 11:21
@franramirez688
Copy link
Contributor Author

I want to add another test using Objective-C++ (typical hello.lib and demo app linking with it)

For now, I'm not adding it because of the complexity of the code. It seems that a simple Objective-C++ (Objective-C and C++) project must have a kind of wrapper in the middle of C++ and Objective-C (see more information here). I guess it's enough with those tests to verify it's working.

# Objective C/C++ ones
self.objc = "clang"
self.objcpp = "clang++"
self.objc_args = self._get_env_list(build_env.get('OBJCFLAGS', []))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still feel this is problematic, having 2 mechanisms to define CXX_FLAGS (env and conf). Not related to this PR, I know it is already this way for C/C++ flags, but something we want to clarify for the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I absolutely agree. I can open a "look-into" feature to have this into account for future releases.

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.

[MesonToolchain] Add Objective-C/C++ arguments
3 participants