Reviewed By: adamjernst Differential Revision: D6527119 fbshipit-source-id: 1e31b9491d2cf501f348d544482c025096fd81b1
76 lines
2.1 KiB
Python
76 lines
2.1 KiB
Python
# Copyright (c) 2014-present, Facebook, Inc.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the BSD-style license found in the
|
|
# LICENSE file in the root directory of this source tree. An additional grant
|
|
# of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
load("@xplat//configurations/buck:default_platform_defs.bzl", "is_apple_platform")
|
|
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library")
|
|
|
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
|
|
|
csharp_library(
|
|
name = "yogalibnet46",
|
|
srcs = glob(["**/*.cs"]),
|
|
dll_name = "Facebook.Yoga.dll",
|
|
framework_ver = "net46",
|
|
)
|
|
|
|
csharp_library(
|
|
name = "yogalibnet45",
|
|
srcs = glob(["**/*.cs"]),
|
|
dll_name = "Facebook.Yoga.dll",
|
|
framework_ver = "net45",
|
|
)
|
|
|
|
cxx_library(
|
|
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")],
|
|
)
|
|
|
|
if is_apple_platform():
|
|
yoganet_ios_srcs = []
|
|
for arch in [
|
|
'iphonesimulator-x86_64', 'iphonesimulator-i386', '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'],
|
|
)
|
|
|
|
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
|
|
genrule(
|
|
name = 'yoganet-macosx',
|
|
srcs = [
|
|
yoga_dep(yoganet_macosx_target % 'x86_64'),
|
|
yoga_dep(yoganet_macosx_target % 'i386'),
|
|
],
|
|
out = 'libyoga.dylib',
|
|
cmd = 'lipo $SRCS -create -output $OUT',
|
|
visibility = ['PUBLIC'],
|
|
)
|