2022-06-07 07:42:49 -07:00
|
|
|
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2018-10-24 03:09:58 -07:00
|
|
|
#
|
2019-10-15 10:30:08 -07:00
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
|
|
|
|
2022-06-07 07:42:49 -07:00
|
|
|
|
2017-01-30 08:39:39 -08:00
|
|
|
Pod::Spec.new do |spec|
|
|
|
|
spec.name = 'Yoga'
|
2023-06-12 15:53:16 -07:00
|
|
|
spec.version = '2.0.0'
|
2018-02-16 18:25:02 -08:00
|
|
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
2018-03-23 05:31:44 -07:00
|
|
|
spec.homepage = 'https://yogalayout.com/'
|
|
|
|
spec.documentation_url = 'https://yogalayout.com/docs'
|
2017-01-26 10:38:02 -08:00
|
|
|
|
2023-06-13 11:33:58 -07:00
|
|
|
spec.summary = 'An embeddable and performant flexbox layout engine with bindings for multiple languages'
|
2017-01-30 08:39:39 -08:00
|
|
|
|
2023-06-13 11:33:58 -07:00
|
|
|
spec.authors = {'Meta Open Source' => 'opensource@meta.com'}
|
2017-01-30 08:39:39 -08:00
|
|
|
spec.source = {
|
2017-01-26 10:38:02 -08:00
|
|
|
:git => 'https://github.com/facebook/yoga.git',
|
2023-06-06 14:56:44 -07:00
|
|
|
:tag => "v#{spec.version.to_s}",
|
2017-01-26 10:38:02 -08:00
|
|
|
}
|
2023-06-06 14:56:44 -07:00
|
|
|
|
|
|
|
spec.ios.deployment_target = "13.4"
|
|
|
|
|
2017-01-30 08:39:39 -08:00
|
|
|
spec.module_name = 'yoga'
|
|
|
|
spec.requires_arc = false
|
2018-07-12 07:26:17 -07:00
|
|
|
spec.pod_target_xcconfig = {
|
|
|
|
'DEFINES_MODULE' => 'YES'
|
|
|
|
}
|
2017-01-30 08:39:39 -08:00
|
|
|
spec.compiler_flags = [
|
2017-01-26 10:38:02 -08:00
|
|
|
'-fno-omit-frame-pointer',
|
|
|
|
'-fexceptions',
|
|
|
|
'-Wall',
|
|
|
|
'-Werror',
|
2023-05-11 09:43:36 -07:00
|
|
|
'-Wextra',
|
2023-09-06 08:16:42 -07:00
|
|
|
'-Wconversion',
|
Breaking: Use C++ 20 (#1382)
Summary:
Pull Request resolved: https://github.com/facebook/yoga/pull/1382
X-link: https://github.com/facebook/react-native/pull/39437
Have been running into places where C++ 20 makes life easier for use like `std::bit_cast` (that one is easy to polyfill), in-class member initializer support for bitfields, designated initializers, defaulted comparison operator, concepts instead of SFINAE, and probably more.
Our other infra is in the process of making this jump, or already has. This tests it out everywhere, across the various reference builds, to see if we have any issues.
This is a bit more aggressive than I had previously communicated, but n - 1 is going to be a better long term place than n - 2.
If we wanted to use `std::bit_cast` we would need one of:
1. GCC 11+ (~2.5 years old)
1. Clang 14 (~2.5 years old)
1. VS 16.11 (~2 years old)
For mobile this means:
1. NDK 26 (still in Beta 😭)
1. XCode 14.3.0 (~6 months old)
https://en.cppreference.com/w/cpp/compiler_support/20
That isn't quite doable yet, but we can start taking advantage of language features in the meantime. More of these will be supported in older toolchains.
Anyone needing support for older C++ versions can lag behind on more recent changes. E.g. Yoga 2.0 supports C++ 14.
bypass-github-export-checks
Changelog: [Internal]
Reviewed By: cortinico
Differential Revision: D49261607
fbshipit-source-id: 38301204d56b7bc8410c2dda9c291da1b8d61ec1
2023-09-19 00:29:50 -07:00
|
|
|
'-std=c++20',
|
2017-01-26 10:38:02 -08:00
|
|
|
'-fPIC'
|
|
|
|
]
|
C++ Cleanup 1/N: Reorganize YGStyle (#1349)
Summary:
X-link: https://github.com/facebook/react-native/pull/39221
Pull Request resolved: https://github.com/facebook/yoga/pull/1349
X-link: https://github.com/facebook/react-native/pull/39171
## This diff
This diff adds a `style` directory for code related to storing and manipulating styles. `YGStyle`, which is not a public API, is renamed to `yoga::Style` and moved into this folder, alongside `CompactValue`. We will eventually add `ValuePool` alongside this for the next generation style representation.
## This stack
The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers
This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes
This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.
These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D48847261
fbshipit-source-id: 0fc8c6991e19079f3f0d55d368574757e453fe93
2023-08-30 16:27:32 -07:00
|
|
|
|
2023-08-29 23:27:25 -07:00
|
|
|
spec.swift_version = '5.1'
|
C++ Cleanup 1/N: Reorganize YGStyle (#1349)
Summary:
X-link: https://github.com/facebook/react-native/pull/39221
Pull Request resolved: https://github.com/facebook/yoga/pull/1349
X-link: https://github.com/facebook/react-native/pull/39171
## This diff
This diff adds a `style` directory for code related to storing and manipulating styles. `YGStyle`, which is not a public API, is renamed to `yoga::Style` and moved into this folder, alongside `CompactValue`. We will eventually add `ValuePool` alongside this for the next generation style representation.
## This stack
The organization of the C++ internals of Yoga are in need of attention.
1. Some of the C++ internals are namespaced, but others not.
2. Some of the namespaces include `detail`, but are meant to be used outside of the translation unit (FB Clang Tidy rules warn on any usage of these)
2. Most of the files are in a flat hierarchy, except for event tracing in its own folder
3. Some files and functions begin with YG, others don’t
4. Some functions are uppercase, others are not
5. Almost all of the interesting logic is in Yoga.cpp, and the file is too large to reason about
6. There are multiple grab bag files where folks put random functions they need in (Utils, BitUtils, Yoga-Internal.h)
7. There is no clear indication from file structure or type naming what is private vs not
8. Handles like `YGNodeRef` and `YGConfigRef` can be used to access internals just by importing headers
This stack does some much needed spring cleaning:
1. All non-public headers and C++ implementation details are in separate folders from the root level `yoga`. This will give us room to split up logic and add more files without too large a flat hierarchy
3. All private C++ internals are under the `facebook::yoga` namespace. Details namespaces are only ever used within the same header, as they are intended
4. Utils files are split
5. Most C++ internals drop the YG prefix
6. Most C++ internal function names are all lower camel case
7. We start to split up Yoga.cpp
8. Every header beginning with YG or at the top-level directory is public and C only, with the exception of Yoga-Internal.h which has non-public functions for bindings
9. It is not possible to use private APIs without static casting handles to internal classes
This will give us more leeway to continue splitting monolithic files, and consistent guidelines for style in new files as well.
These changes should not be breaking to any project using only public Yoga headers. This includes every usage of Yoga in fbsource except for RN Fabric which is currently tied to internals. This refactor should make that boundary clearer.
Changelog: [Internal]
Reviewed By: shwanton
Differential Revision: D48847261
fbshipit-source-id: 0fc8c6991e19079f3f0d55d368574757e453fe93
2023-08-30 16:27:32 -07:00
|
|
|
spec.source_files = 'yoga/**/*.{h,cpp}'
|
|
|
|
spec.header_mappings_dir = 'yoga'
|
|
|
|
|
|
|
|
public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
|
|
|
|
spec.public_header_files = public_header_files
|
|
|
|
|
|
|
|
all_header_files = 'yoga/**/*.h'
|
|
|
|
spec.private_header_files = Dir.glob(all_header_files) - Dir.glob(public_header_files)
|
2017-01-26 10:38:02 -08:00
|
|
|
end
|