Build with Yoga, clang < 3.9 with Mac M1

Hi there,
Complete newbie here ready to port my games to Defold.
I am trying to build the Yoga example project (https://github.com/farism/defold-yoga) and I am facing an error on my M1 Mac.

/yoga/src/extension.cpp
	Line 9: In file included from upload/yoga/src/extension.cpp:9:
In file included from upload/yoga/src/./yoga/Yoga.h:21:
In file included from upload/yoga/src/./yoga/YGEnums.h:11:
unknown type name 'constexpr'
constexpr int count(); // can't use `= delete` due to a defect in clang < 3.9
^

I have llvm 17.0.6 installed via homebrew on my Mac M1 Mini.

Any ideas? thanks :slight_smile:

1 Like

(sorry, should have said this is the headlining error message, the generated issues are truncated as they are that long)

Our builds happen in the cloud. It doesn’t use your local sdk’s.

The example works for me, building on my iMac:

The compile error suggests that it can’t find the ext.manifest, which enables -std=c++14.

Which version of Defold are you using?
How did you setup the Yoga project?

Thanks, I am using Defold 1.6.2, but I haven’t set up a ext.manifest so that could be my issue.
I am using the github example code for Yoga.

Got it! Edited ext.manifest from the Yoga code to include

    arm64-osx:
        context:
            flags: ["-std=c++14"]

Thank you! Loving Defold so far!

2 Likes

You shouldn’t need to, as it’s part of the example project.

But now I figured out that that ext.manifest from that example project, doesn’t contain an entry for arm64-osx.
I submitted an issue for that repository.

Great that you figured it out!
If you want to do the same later on, if you’re using the extension-yoga as a dependency, you’ll want to do the same fix, but using a game.appmanifest.

3 Likes