Skylarkify yoga build defs.
Summary: Top-level `if` statements are not allowed in a new Buck parser - Skylark. https://buckbuild.com/concept/skylark.html Reviewed By: grzmiel Differential Revision: D8849590 fbshipit-source-id: 6648135f23e058adfeddf574932f8a98c7831fee
This commit is contained in:
committed by
Facebook Github Bot
parent
910aa77c01
commit
896cfbdfde
48
csharp/BUCK
48
csharp/BUCK
@@ -3,7 +3,14 @@
|
|||||||
# This source code is licensed under the MIT license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree.
|
# LICENSE file in the root directory of this source tree.
|
||||||
|
|
||||||
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "is_apple_platform", "yoga_cxx_library", "yoga_dep")
|
load(
|
||||||
|
"//:yoga_defs.bzl",
|
||||||
|
"BASE_COMPILER_FLAGS",
|
||||||
|
"is_apple_platform",
|
||||||
|
"yoga_cxx_library",
|
||||||
|
"yoga_dep",
|
||||||
|
"yoga_apple_binary",
|
||||||
|
)
|
||||||
|
|
||||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
||||||
|
|
||||||
@@ -32,41 +39,4 @@ yoga_cxx_library(
|
|||||||
deps = [yoga_dep(":yoga")],
|
deps = [yoga_dep(":yoga")],
|
||||||
)
|
)
|
||||||
|
|
||||||
if is_apple_platform():
|
yoga_apple_binary()
|
||||||
yoganet_ios_srcs = []
|
|
||||||
for arch in [
|
|
||||||
"iphonesimulator-x86_64",
|
|
||||||
"iphoneos-arm64",
|
|
||||||
]:
|
|
||||||
name = "yoganet-" + arch
|
|
||||||
yoganet_ios_srcs.append(":" + name)
|
|
||||||
genrule(
|
|
||||||
name = name,
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(":yogaApple#%s,static" % arch),
|
|
||||||
yoga_dep("YogaKit:YogaKitApple#%s,static" % arch),
|
|
||||||
yoga_dep("csharp:yoganetApple#%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"],
|
|
||||||
)
|
|
||||||
|
|
||||||
yoganet_macosx_target = "csharp:yoganetAppleMac#macosx-%s,dynamic"
|
|
||||||
genrule(
|
|
||||||
name = "yoganet-macosx",
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(yoganet_macosx_target % "x86_64"),
|
|
||||||
],
|
|
||||||
out = "libyoga.dylib",
|
|
||||||
cmd = "lipo $SRCS -create -output $OUT",
|
|
||||||
visibility = ["PUBLIC"],
|
|
||||||
)
|
|
||||||
|
@@ -190,3 +190,43 @@ def yoga_prebuilt_jar(*args, **kwargs):
|
|||||||
|
|
||||||
def is_apple_platform():
|
def is_apple_platform():
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def yoga_apple_binary():
|
||||||
|
if is_apple_platform():
|
||||||
|
yoganet_ios_srcs = []
|
||||||
|
for arch in [
|
||||||
|
"iphonesimulator-x86_64",
|
||||||
|
"iphoneos-arm64",
|
||||||
|
]:
|
||||||
|
name = "yoganet-" + arch
|
||||||
|
yoganet_ios_srcs.append(":" + name)
|
||||||
|
native.genrule(
|
||||||
|
name = name,
|
||||||
|
srcs = [
|
||||||
|
yoga_dep(":yogaApple#%s,static" % arch),
|
||||||
|
yoga_dep("YogaKit:YogaKitApple#%s,static" % arch),
|
||||||
|
yoga_dep("csharp:yoganetApple#%s,static" % arch),
|
||||||
|
],
|
||||||
|
out = "libyoga-%s.a" % arch,
|
||||||
|
cmd = "libtool -static -o $OUT $SRCS",
|
||||||
|
visibility = [yoga_dep("csharp:yoganet-ios")],
|
||||||
|
)
|
||||||
|
|
||||||
|
native.genrule(
|
||||||
|
name = "yoganet-ios",
|
||||||
|
srcs = yoganet_ios_srcs,
|
||||||
|
out = "libyoga.a",
|
||||||
|
cmd = "lipo $SRCS -create -output $OUT",
|
||||||
|
visibility = ["PUBLIC"],
|
||||||
|
)
|
||||||
|
|
||||||
|
yoganet_macosx_target = "csharp:yoganetAppleMac#macosx-%s,dynamic"
|
||||||
|
native.genrule(
|
||||||
|
name = "yoganet-macosx",
|
||||||
|
srcs = [
|
||||||
|
yoga_dep(yoganet_macosx_target % "x86_64"),
|
||||||
|
],
|
||||||
|
out = "libyoga.dylib",
|
||||||
|
cmd = "lipo $SRCS -create -output $OUT",
|
||||||
|
visibility = ["PUBLIC"],
|
||||||
|
)
|
||||||
|
Reference in New Issue
Block a user