Files
yoga/Yoga.podspec

42 lines
1.1 KiB
Plaintext
Raw Normal View History

# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
Pod::Spec.new do |spec|
spec.name = 'Yoga'
2023-07-25 09:47:27 -07:00
spec.version = '2.0.0'
spec.license = { :type => 'MIT', :file => "LICENSE" }
spec.homepage = 'https://yogalayout.com/'
spec.documentation_url = 'https://yogalayout.com/docs'
spec.summary = 'An embeddable and performant flexbox layout engine with bindings for multiple languages'
spec.authors = {'Meta Open Source' => 'opensource@meta.com'}
spec.source = {
:git => 'https://github.com/facebook/yoga.git',
:tag => "v#{spec.version.to_s}",
}
spec.ios.deployment_target = "13.4"
spec.module_name = 'yoga'
spec.requires_arc = false
Feature podspec modules (#793) Summary: This PR adds support for using Yoga Swift dependents when Yoga is pulled as a static library. Currently swift projects trying to pull static libraries are unable to import the module. The reason for that is because the `DEFINES_MODULES` build setting is set to`NO`. If a Swift Framework is trying to `pod spec lint --use-libraries` with `Yoga` as a dependency, the validation will fail. With the `DEFINES_MODULE` enabled, the product will be treated as defining its own module. This enables automatic production of LLVM module map files when appropriate, and allows the product to be imported as a module. A workaround to this issue would be passing the `:modular_headers` flag to the `Podfile`, but that would not fix the `pod spec lint` validation for framework/library dependencies, it would just allow consuming applications to build and run. An example of this issue would be [SonarKit](https://github.com/facebook/Sonar/blob/master/iOS/SonarKit.podspec). `SonarKit` wasn't able to validate its podspec due to `YogaKit` (Swift Framework) depending on `Yoga` and SonarKit validating with the `--use-libraries` flag due to the c++ dependencies. We had to create a new version of [Yoga 1.9 podspec](https://github.com/facebook/Sonar/blob/master/Specs/Yoga/1.9/Yoga.podspec.json) and make sure to set the `DEFINES_MODULE` flag of the pod target. After that, we were able to `pod spec lint` `SonarKit.podspec` successfully. After merging a new `tag` should be created and the new podspec should be pushed to cocoapods master repository. Pull Request resolved: https://github.com/facebook/yoga/pull/793 Reviewed By: passy Differential Revision: D8820126 Pulled By: priteshrnandgaonkar fbshipit-source-id: 98eae3c31ec67a03c0fe97e05ab9e79446fa9f78
2018-07-12 07:26:17 -07:00
spec.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES'
}
spec.compiler_flags = [
'-fno-omit-frame-pointer',
'-fexceptions',
'-Wall',
'-Werror',
'-Wextra',
'-std=c++14',
'-fPIC'
]
Remove private headers exposed by podspecs (#940) Summary: X-link: https://github.com/facebook/litho/pull/940 Pull Request resolved: https://github.com/facebook/yoga/pull/1252 X-link: https://github.com/facebook/react-native/pull/36993 Fabric relies on the private C++ internals of Yoga. This creates a conundrum in the open source build due to how header creation in Cocoapods works. 1. The default mechanism of specifying public headers needs to include the private headers for them to be made usable by fabric (by default) 2. Cocoapods will roll up all of the public headers when importing a module https://github.com/facebook/react-native/pull/33381 fixed the Fabric Cocoapods build which ran into this. React Native relies on FlipperKit which relies on YogaKit, which in turn finally imports the Yoga podspec. Because YogaKit may use Swift, we can only expose the public Yoga C ABI. The first solution in that PR was to allow RN to access Yoga private headers, but this was changed to instead make all Yoga headers public, and to add ifdefs to all of them to no-op when included outside of a C++ environment. Talking to Kudo, we should be able to change back to the earlier approach in the PR, to instead expose the private headers to only RN. This lets us avoid exposing headers that we ideally wouldn't be, and lets us avoid the messy ifdefs in every Yoga header. Changelog: [Internal] Reviewed By: rshest Differential Revision: D45139075 fbshipit-source-id: 99152986a578f7aac8324dffe0e18c42a38cc6a5
2023-04-26 17:27:29 -07:00
spec.source_files = 'yoga/**/*.{h,cpp}'
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
spec.swift_version = '5.1'
end