2016-09-22 16:22:34 -07:00
|
|
|
# Copyright (c) 2014-present, Facebook, Inc.
|
|
|
|
#
|
2018-02-16 18:24:55 -08:00
|
|
|
# This source code is licensed under the MIT license found in the
|
|
|
|
# LICENSE file in the root directory of this source tree.
|
2016-09-22 16:22:34 -07:00
|
|
|
|
2018-05-20 23:06:59 -07:00
|
|
|
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "is_apple_platform", "yoga_cxx_library", "yoga_dep")
|
2016-12-15 12:44:19 -08:00
|
|
|
|
2017-02-24 21:40:45 -08:00
|
|
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
2016-12-15 12:44:19 -08:00
|
|
|
|
2016-09-22 16:22:34 -07:00
|
|
|
csharp_library(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "yogalibnet46",
|
|
|
|
srcs = glob(["**/*.cs"]),
|
|
|
|
dll_name = "Facebook.Yoga.dll",
|
|
|
|
framework_ver = "net46",
|
2016-09-22 16:22:34 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
csharp_library(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "yogalibnet45",
|
|
|
|
srcs = glob(["**/*.cs"]),
|
|
|
|
dll_name = "Facebook.Yoga.dll",
|
|
|
|
framework_ver = "net45",
|
2016-09-22 16:22:34 -07:00
|
|
|
)
|
2016-12-15 12:44:19 -08:00
|
|
|
|
2018-04-14 12:39:23 -07:00
|
|
|
yoga_cxx_library(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "yoganet",
|
|
|
|
srcs = glob(["Yoga/YGInterop.cpp"]),
|
|
|
|
compiler_flags = COMPILER_FLAGS,
|
|
|
|
link_style = "static",
|
|
|
|
link_whole = True,
|
|
|
|
soname = "libyoga.$(ext)",
|
|
|
|
visibility = ["PUBLIC"],
|
|
|
|
deps = [yoga_dep(":yoga")],
|
2016-12-15 12:44:19 -08:00
|
|
|
)
|
2016-12-16 06:53:47 -08:00
|
|
|
|
2017-11-26 20:44:38 -08:00
|
|
|
if is_apple_platform():
|
2018-05-20 23:06:59 -07:00
|
|
|
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")],
|
|
|
|
)
|
|
|
|
|
2016-12-16 06:53:47 -08:00
|
|
|
genrule(
|
2018-05-20 23:06:59 -07:00
|
|
|
name = "yoganet-ios",
|
|
|
|
srcs = yoganet_ios_srcs,
|
|
|
|
out = "libyoga.a",
|
|
|
|
cmd = "lipo $SRCS -create -output $OUT",
|
|
|
|
visibility = ["PUBLIC"],
|
2016-12-16 06:53:47 -08:00
|
|
|
)
|
|
|
|
|
2018-05-20 23:06:59 -07:00
|
|
|
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"],
|
|
|
|
)
|