2018-09-11 15:27:47 -07:00
|
|
|
# Copyright (c) Facebook, Inc. and its affiliates.
|
2016-07-25 06:31:32 -07:00
|
|
|
#
|
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.
|
2018-08-28 21:54:41 -07:00
|
|
|
load("//tools/build_defs/oss:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "subdir_glob", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep")
|
2016-07-25 06:31:32 -07:00
|
|
|
|
|
|
|
GMOCK_OVERRIDE_FLAGS = [
|
2017-02-24 21:40:45 -08:00
|
|
|
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
|
|
|
"-Wno-inconsistent-missing-override",
|
2016-07-25 06:31:32 -07:00
|
|
|
]
|
|
|
|
|
2017-12-05 08:16:49 -08:00
|
|
|
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
|
2019-03-13 07:25:13 -07:00
|
|
|
"-DDEBUG",
|
2019-05-09 04:14:08 -07:00
|
|
|
"-DYG_ENABLE_EVENTS",
|
2017-12-05 08:16:49 -08:00
|
|
|
]
|
2016-07-25 06:31:32 -07:00
|
|
|
|
2018-04-14 12:39:23 -07:00
|
|
|
yoga_cxx_library(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "yoga",
|
2019-05-09 07:42:34 -07:00
|
|
|
srcs = glob(["yoga/**/*.cpp"]),
|
2019-05-14 13:35:05 -07:00
|
|
|
compiler_flags = LIBRARY_COMPILER_FLAGS,
|
2019-06-15 12:03:49 -07:00
|
|
|
public_include_directories = ["."],
|
|
|
|
raw_headers = glob(["yoga/**/*.h"]),
|
2017-02-24 21:40:45 -08:00
|
|
|
soname = "libyogacore.$(ext)",
|
|
|
|
tests = [":YogaTests"],
|
|
|
|
visibility = ["PUBLIC"],
|
2017-12-13 14:43:19 -08:00
|
|
|
deps = [
|
2017-02-24 21:40:45 -08:00
|
|
|
yoga_dep("lib/fb:ndklog"),
|
|
|
|
],
|
2016-07-25 06:31:32 -07:00
|
|
|
)
|
|
|
|
|
2019-03-13 07:25:13 -07:00
|
|
|
yoga_cxx_library(
|
|
|
|
name = "yogaForDebug",
|
2019-05-09 07:42:34 -07:00
|
|
|
srcs = glob(["yoga/**/*.cpp"]),
|
2019-03-13 07:25:13 -07:00
|
|
|
compiler_flags = TEST_COMPILER_FLAGS,
|
2019-06-15 12:03:49 -07:00
|
|
|
public_include_directories = ["."],
|
|
|
|
raw_headers = glob(["yoga/**/*.h"]),
|
2019-03-13 07:25:13 -07:00
|
|
|
soname = "libyogacore.$(ext)",
|
|
|
|
tests = [":YogaTests"],
|
|
|
|
visibility = ["PUBLIC"],
|
|
|
|
deps = [
|
2019-06-24 17:06:43 -07:00
|
|
|
":yoga",
|
2019-03-13 07:25:13 -07:00
|
|
|
yoga_dep("lib/fb:ndklog"),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2018-04-14 12:39:23 -07:00
|
|
|
yoga_cxx_test(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "YogaTests",
|
|
|
|
srcs = glob(["tests/*.cpp"]),
|
2018-12-14 09:20:27 -08:00
|
|
|
headers = subdir_glob([("", "yoga/**/*.h")]),
|
2017-02-24 21:40:45 -08:00
|
|
|
compiler_flags = TEST_COMPILER_FLAGS,
|
|
|
|
contacts = ["emilsj@fb.com"],
|
|
|
|
visibility = ["PUBLIC"],
|
|
|
|
deps = [
|
2019-03-13 07:25:13 -07:00
|
|
|
":yogaForDebug",
|
2019-05-09 04:14:08 -07:00
|
|
|
yoga_dep("testutil:testutil"),
|
2017-02-24 21:40:45 -08:00
|
|
|
GTEST_TARGET,
|
|
|
|
],
|
2016-07-25 06:31:32 -07:00
|
|
|
)
|