Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#36975 closed enhancement (fixed)

PortGroup cmake: integration with muniversal portgroup

Reported by: NicosPavlov Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc: pixilla (Bradley Giesbrecht), ryandesign (Ryan Schmidt)
Port:

Description

In the present state, the cmake portgroup does not integrate well with the muniversal one, as it forces building multiple architectures together in case of +universal variant:

configure.universal_args-append \
            -DCMAKE_OSX_ARCHITECTURES=\"[join ${configure.universal_archs} \;]\"

This code should be deactivated in case of muniversal portgroup to enable separate builds. Attached are patches in order to make it possible. The way may be naive as it requires adding a global variable to muniversal, but it works according to my tests.

My apologies if I cc'ed the wrong person, but I am not sure of who should be assigned in case of Portgroups.

Attachments (2)

patch-cmake-1.0.diff (663 bytes) - added by NicosPavlov 7 years ago.
patch-muniversal-1.0.diff (548 bytes) - added by NicosPavlov 7 years ago.

Download all attachments as: .zip

Change History (8)

Changed 7 years ago by NicosPavlov

Attachment: patch-cmake-1.0.diff added

Changed 7 years ago by NicosPavlov

Attachment: patch-muniversal-1.0.diff added

comment:1 Changed 7 years ago by jmroot (Joshua Root)

Does this actually work? Doesn't it result in CMAKE_OSX_ARCHITECTURES not being set at all when using muniversal?

comment:2 Changed 7 years ago by NicosPavlov

It indeed does not set it, but to my experience it does work. Other programs can build universal on top of it and link, for example. I assumed that without CMAKE_OSX_ARCHITECTURES, the build is falling back to -arch flag, which is properly set by muniversal.

However, as I said, I naively tried it, and saw that it appeared to work.

comment:3 Changed 7 years ago by pixilla (Bradley Giesbrecht)

Cc: pixilla@… added

Cc Me!

comment:4 Changed 7 years ago by ryandesign (Ryan Schmidt)

Cc: ryandesign@… added

Cc Me!

comment:5 Changed 7 years ago by ryandesign (Ryan Schmidt)

Resolution: fixed
Status: newclosed

Since we set CMAKE_OSX_ARCHITECTURES both for universal and non-universal builds now, it seems to me that we should continue to set it in all cases, since I don't know what the implications are of not doing so. Fixed in r99819.

Note that I didn't add a new global variable to the muniversal portgroup, but checked for the existence of an option it already defines.

comment:6 Changed 7 years ago by ryandesign (Ryan Schmidt)

A further fix, to the muniversal portgroup, in r103445, to not add a --host argument when using cmake.

Note: See TracTickets for help on using tickets.