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

'YGEnums.h' file not found - When adding FlexLayout as dependency of another Swift Package. #219

Closed
lukewakeford opened this issue Feb 28, 2023 · 8 comments
Labels

Comments

@lukewakeford
Copy link
Contributor

I'm following installation steps to add FlexLayout to "Another Swift Package" not to an Xcode Project.

I have defined the dependency in my Package.swift as:

.package(
    url: "https://github.com/layoutBox/FlexLayout", "1.3.29"..<"2.0.0"
),

and linked it to my target

dependencies: [
    "FlexLayout",
    ...
]

The package resolves fine but errors when building with

'YGEnums.h' file not found

As far as I can see there is no way of adding GCC_PREPROCESSOR_DEFINITIONS in Package.swift

@lucdion
Copy link
Member

lucdion commented Mar 1, 2023

Sorry, I haven't try that before. If you find a solution, please tell us, we will add it to the documentation.

@lukewakeford
Copy link
Contributor Author

I don't think there is a solution - the documentation may need updating to reflect that 😞

@PetrosTepoyan
Copy link

Same

@lukewakeford
Copy link
Contributor Author

lukewakeford commented Mar 6, 2023

I take it back, looks like there is a fix! I was able to get SPM to build FlexLayout as a dependency by adding the built in preprocessor definition SWIFT_PACAKAGE which means the yoga imports are now located correctly.

@lucdion
Copy link
Member

lucdion commented Mar 11, 2023

@sergeymild
Copy link

any progress? because it doesn't work, i have tried to add Flexlayout as dependency to another Swift package and have got these errors
Screenshot 2023-08-15 at 4 31 25 AM

@lukewakeford
Copy link
Contributor Author

You have to add the flag in the target settings, see here: #226 (comment)

@sergeymild
Copy link

it is not SwiftPackage it is Pod

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

No branches or pull requests

4 participants