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
This commit is contained in:
committed by
Facebook Github Bot
parent
0296511f2c
commit
ba0bb10366
28
csharp/BUCK
28
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'],
|
||||
)
|
||||
|
Reference in New Issue
Block a user