From ba0bb103669e2510bb6a2daf5393c2c4495644de Mon Sep 17 00:00:00 2001 From: Kazuki Sakamoto Date: Fri, 16 Dec 2016 06:53:47 -0800 Subject: [PATCH 1/2] Build iOS fat static library for Unity and Xamarin Summary: $ buck build //csharp:yoganet-ios $ buck targets --show-output //csharp:yoganet-ios //csharp:yoganet-ios buck-out/gen/csharp/yoganet-ios/libyoga.a $ lipo -info buck-out/gen/csharp/yoganet-ios/libyoga.a Architectures in the fat file: buck-out/gen/csharp/yoganet-ios/libyoga.a are: armv7 x86_64 arm64 $ nm buck-out/gen/csharp/yoganet-ios/libyoga.a|grep -e 'T _YGNodeNew' -e 'ygNode' -e 'T _YGInteropSetLogger' 0000000000000000 T _YGNodeNew 0000000000001070 t -[UIView(Yoga) ygNode] 0000000000000000 T _YGInteropSetLogger Closes https://github.com/facebook/yoga/pull/286 Reviewed By: emilsjolander Differential Revision: D4338919 Pulled By: splhack fbshipit-source-id: 7acfdfa0dc4d152d7bfe92161efdeb9f161f70e6 --- csharp/BUCK | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/csharp/BUCK b/csharp/BUCK index 7517c930..8fc408eb 100644 --- a/csharp/BUCK +++ b/csharp/BUCK @@ -33,3 +33,31 @@ cxx_library( deps = [yoga_dep(':yoga')], visibility = ['PUBLIC'], ) + +with allow_unsafe_import(): + import os + +if os.path.isdir('/Applications/Xcode.app'): + yoganet_ios_srcs = [] + for arch in ['iphonesimulator-x86_64', 'iphoneos-arm64', 'iphoneos-armv7']: + name = 'yoganet-' + arch + yoganet_ios_srcs.append(':' + name) + genrule( + name = name, + srcs = [ + yoga_dep(':yoga#%s,static' % arch), + yoga_dep('YogaKit:YogaKit#%s,static' % arch), + yoga_dep('csharp:yoganet#%s,static' % arch), + ], + out = 'libyoga-%s.a' % arch, + cmd = 'libtool -static -o $OUT $SRCS', + visibility = [yoga_dep('csharp:yoganet-ios')], + ) + + genrule( + name = 'yoganet-ios', + srcs = yoganet_ios_srcs, + out = 'libyoga.a', + cmd = 'lipo $SRCS -create -output $OUT', + visibility = ['PUBLIC'], + ) From 74fb205083256a607d6e39bf05d7b8e6bcb60471 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Fri, 16 Dec 2016 09:03:52 -0800 Subject: [PATCH 2/2] Rename test files to match other test file names Summary: Rename test files to match other test file names Differential Revision: D4335198 fbshipit-source-id: b8f38162c3094231476059eb1f54326d8ba84848 --- tests/{YGLayoutAspectRatioTest.cpp => YGAspectRatioTest.cpp} | 0 tests/{YGLayoutDefaultValuesTest.cpp => YGDefaultValuesTest.cpp} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename tests/{YGLayoutAspectRatioTest.cpp => YGAspectRatioTest.cpp} (100%) rename tests/{YGLayoutDefaultValuesTest.cpp => YGDefaultValuesTest.cpp} (100%) diff --git a/tests/YGLayoutAspectRatioTest.cpp b/tests/YGAspectRatioTest.cpp similarity index 100% rename from tests/YGLayoutAspectRatioTest.cpp rename to tests/YGAspectRatioTest.cpp diff --git a/tests/YGLayoutDefaultValuesTest.cpp b/tests/YGDefaultValuesTest.cpp similarity index 100% rename from tests/YGLayoutDefaultValuesTest.cpp rename to tests/YGDefaultValuesTest.cpp