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

Support lists for ObjC and ObjC++ standards #13642

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

Conversation

dcbaker
Copy link
Member

@dcbaker dcbaker commented Sep 6, 2024

Also, share the implementations between the C and ObjC, and C++ and OjbC++ instance of both Clang and GNU compilers, so that we update once, and only once for each compiler.

Mostly this just ends up moving code around.

Fixes: #13639

@dcbaker
Copy link
Member Author

dcbaker commented Sep 6, 2024

I have tested this with Clang and with GCC, but only far enough with GCC to get to the point it fails because my GCC build doesn't have ObjC[++] support.

mesonbuild/compilers/c.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/c.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/c.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/cpp.py Fixed Show fixed Hide fixed
mesonbuild/compilers/cpp.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objc.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objc.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objcpp.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objcpp.py Dismissed Show dismissed Hide dismissed
@bruchar1
Copy link
Member

bruchar1 commented Sep 6, 2024

Should there be a test for that, to ensure every compiler supports the same syntax for std option?

@dcbaker
Copy link
Member Author

dcbaker commented Sep 12, 2024

It was worth writing the tests, I found some issues that weren't being caught by our existing tests.

mesonbuild/compilers/cpp.py Outdated Show resolved Hide resolved
unittests/allplatformstests.py Show resolved Hide resolved
@dcbaker
Copy link
Member Author

dcbaker commented Sep 25, 2024

Also in the latest version, use mixins for the Apple version overrides

To avoid duplication between C and ObjC
Check clang-cl as well as cl, and clang as well as gcc.
This tests ObjC and ObjC++ both with and without C enabled. I did this
because I ran into issues where ObjC only worked when C was enabled, and
then a later bug where C was disabled, due to the fact that C and ObjC
both use `c_std` and not `objc_std`.
mesonbuild/compilers/c.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/cpp.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/cpp.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objc.py Dismissed Show dismissed Hide dismissed
mesonbuild/compilers/objcpp.py Dismissed Show dismissed Hide dismissed
@bgilbert
Copy link
Contributor

xref #13713: it'd be good to produce a future-feature warning if ObjC is used with a list of standards. Otherwise projects might be surprised e.g. if they use Objective C on macOS, don't CI on macOS with older Meson, and switch to c_std=gnuXX,cXX. (I tripped over this in glib, and CI caught it only because this PR hasn't shipped.)

Since this is optional, we should not accept that GCC is a valid ObjC or
G++ is a valid ObjC++ Compiler unless we've tested that they can
actually do a basic compile.

This requires fixing a number of tests that have broken assumptions. In
some cases I've split tests where issues with one language would hide
the other. It would be great if we had a competent test framework that
allowed subtests to skip, unfortunately we have python's unittest
instead. Because of that we can't avoid extra tests by use of subtests.
@dcbaker
Copy link
Member Author

dcbaker commented Sep 25, 2024

@bgilbert given that this series is already up to 13 patches and is fixing tons of issues with ObjC, I'd prefer to handle that separately, but I assigned that to myself and I'll have a look it at.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

c_std supports list but objc_std doesn't
4 participants