Try to fix MSVC Buck Build (#37242)

Summary:
X-link: https://github.com/facebook/react-native/pull/37242

Pull Request resolved: https://github.com/facebook/yoga/pull/1278

Reviewed By: yungsters

Differential Revision: D45552325

fbshipit-source-id: 5687e8ec27a7a70df66e2f89e800210e3ce21ba3
This commit is contained in:
Nick Gerleman
2023-05-04 00:41:12 -07:00
committed by Facebook GitHub Bot
parent f3633a256b
commit 70153cc16c
16 changed files with 41 additions and 39 deletions

View File

@@ -130,7 +130,7 @@ root = os.path.dirname(os.path.abspath(__file__))
with open(root + "/yoga/YGEnums.h", "w") as f: with open(root + "/yoga/YGEnums.h", "w") as f:
f.write(get_license("cpp")) f.write(get_license("cpp"))
f.write("#pragma once\n") f.write("#pragma once\n")
f.write('#include "YGMacros.h"\n\n') f.write("#include <yoga/YGMacros.h>\n\n")
f.write("// clang-format off\n\n\n") f.write("// clang-format off\n\n\n")
f.write("YG_EXTERN_C_BEGIN\n\n") f.write("YG_EXTERN_C_BEGIN\n\n")
@@ -159,7 +159,7 @@ with open(root + "/yoga/YGEnums.h", "w") as f:
# write out C body for printing # write out C body for printing
with open(root + "/yoga/YGEnums.cpp", "w") as f: with open(root + "/yoga/YGEnums.cpp", "w") as f:
f.write(get_license("cpp")) f.write(get_license("cpp"))
f.write('#include "YGEnums.h"\n\n') f.write("#include <yoga/YGEnums.h>\n\n")
items = sorted(ENUMS.items()) items = sorted(ENUMS.items())
for name, values in items: for name, values in items:
f.write("const char* YG%sToString(const YG%s value) {\n" % (name, name)) f.write("const char* YG%sToString(const YG%s value) {\n" % (name, name))

View File

@@ -10,7 +10,8 @@
#include <bitset> #include <bitset>
#include <cstdio> #include <cstdio>
#include <cstdint> #include <cstdint>
#include "YGEnums.h"
#include <yoga/YGEnums.h>
namespace facebook { namespace facebook {
namespace yoga { namespace yoga {

View File

@@ -7,6 +7,13 @@
#pragma once #pragma once
#include <cmath>
#include <cstdint>
#include <limits>
#include <yoga/YGMacros.h>
#include <yoga/YGValue.h>
#if defined(__has_include) && __has_include(<version>) #if defined(__has_include) && __has_include(<version>)
// needed to be able to evaluate defined(__cpp_lib_bit_cast) // needed to be able to evaluate defined(__cpp_lib_bit_cast)
#include <version> #include <version>
@@ -20,11 +27,6 @@
#else #else
#include <cstring> #include <cstring>
#endif #endif
#include "YGValue.h"
#include "YGMacros.h"
#include <cmath>
#include <cstdint>
#include <limits>
static_assert( static_assert(
std::numeric_limits<float>::is_iec559, std::numeric_limits<float>::is_iec559,

View File

@@ -7,9 +7,10 @@
#pragma once #pragma once
#include "Yoga-internal.h" #include <yoga/Yoga.h>
#include "Yoga.h"
#include "BitUtils.h" #include "BitUtils.h"
#include "Yoga-internal.h"
namespace facebook { namespace facebook {
namespace yoga { namespace yoga {

View File

@@ -7,7 +7,7 @@
// @generated by enums.py // @generated by enums.py
#include "YGEnums.h" #include <yoga/YGEnums.h>
const char* YGAlignToString(const YGAlign value) { const char* YGAlignToString(const YGAlign value) {
switch (value) { switch (value) {

View File

@@ -8,7 +8,7 @@
// @generated by enums.py // @generated by enums.py
#pragma once #pragma once
#include "YGMacros.h" #include <yoga/YGMacros.h>
// clang-format off // clang-format off

View File

@@ -6,9 +6,12 @@
*/ */
#ifdef DEBUG #ifdef DEBUG
#include "YGNodePrint.h"
#include <stdarg.h> #include <stdarg.h>
#include "YGEnums.h"
#include <yoga/YGEnums.h>
#include "YGNodePrint.h"
#include "YGNode.h" #include "YGNode.h"
#include "Yoga-internal.h" #include "Yoga-internal.h"
#include "Utils.h" #include "Utils.h"

View File

@@ -11,7 +11,7 @@
#include <string> #include <string>
#include "Yoga.h" #include <yoga/Yoga.h>
namespace facebook { namespace facebook {
namespace yoga { namespace yoga {

View File

@@ -11,11 +11,12 @@
#include <array> #include <array>
#include <cstdint> #include <cstdint>
#include <type_traits> #include <type_traits>
#include <yoga/Yoga.h>
#include "CompactValue.h" #include "CompactValue.h"
#include "YGEnums.h"
#include "YGFloatOptional.h" #include "YGFloatOptional.h"
#include "Yoga-internal.h" #include "Yoga-internal.h"
#include "Yoga.h"
#include "BitUtils.h" #include "BitUtils.h"
class YOGA_EXPORT YGStyle { class YOGA_EXPORT YGStyle {

View File

@@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
#include "YGValue.h" #include <yoga/YGValue.h>
const YGValue YGValueZero = {0, YGUnitPoint}; const YGValue YGValueZero = {0, YGUnitPoint};
const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined}; const YGValue YGValueUndefined = {YGUndefined, YGUnitUndefined};

View File

@@ -7,8 +7,8 @@
#pragma once #pragma once
#include "YGEnums.h" #include <yoga/YGEnums.h>
#include "YGMacros.h" #include <yoga/YGMacros.h>
YG_EXTERN_C_BEGIN YG_EXTERN_C_BEGIN

View File

@@ -11,8 +11,10 @@
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <vector> #include <vector>
#include <yoga/Yoga.h>
#include "CompactValue.h" #include "CompactValue.h"
#include "Yoga.h"
using YGVector = std::vector<YGNodeRef>; using YGVector = std::vector<YGNodeRef>;

View File

@@ -5,28 +5,20 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
#include "Yoga.h"
#include "log.h"
#include <float.h> #include <float.h>
#include <string.h> #include <string.h>
#include <algorithm> #include <algorithm>
#include <atomic> #include <atomic>
#include <memory> #include <memory>
#include <yoga/Yoga.h>
#include "log.h"
#include "Utils.h" #include "Utils.h"
#include "YGNode.h" #include "YGNode.h"
#include "YGNodePrint.h" #include "YGNodePrint.h"
#include "Yoga-internal.h" #include "Yoga-internal.h"
#include "event/event.h" #include "event/event.h"
#ifdef _MSC_VER
#include <float.h>
/* define fmaxf if < VC12 */
#if _MSC_VER < 1800
__forceinline const float fmaxf(const float a, const float b) {
return (a > b) ? a : b;
}
#endif
#endif
using namespace facebook::yoga; using namespace facebook::yoga;
using detail::Log; using detail::Log;

View File

@@ -18,9 +18,9 @@
#include <stdbool.h> #include <stdbool.h>
#endif #endif
#include "YGEnums.h" #include <yoga/YGEnums.h>
#include "YGMacros.h" #include <yoga/YGMacros.h>
#include "YGValue.h" #include <yoga/YGValue.h>
YG_EXTERN_C_BEGIN YG_EXTERN_C_BEGIN

View File

@@ -5,9 +5,9 @@
* LICENSE file in the root directory of this source tree. * LICENSE file in the root directory of this source tree.
*/ */
#include "log.h" #include <yoga/Yoga.h>
#include "Yoga.h" #include "log.h"
#include "YGConfig.h" #include "YGConfig.h"
#include "YGNode.h" #include "YGNode.h"

View File

@@ -7,7 +7,7 @@
#pragma once #pragma once
#include "YGEnums.h" #include <yoga/YGEnums.h>
struct YGNode; struct YGNode;
struct YGConfig; struct YGConfig;