2016-07-25 06:31:32 -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-07-25 06:31:32 -07:00
|
|
|
|
2017-12-13 14:43:19 -08:00
|
|
|
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "cxx_library", "cxx_test")
|
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-03-17 10:49:59 -07:00
|
|
|
COMPILER_FLAGS = LIBRARY_COMPILER_FLAGS + [
|
2017-11-21 10:10:30 -08:00
|
|
|
"-std=c++1y",
|
2017-02-24 21:40:45 -08:00
|
|
|
]
|
|
|
|
|
2017-12-05 08:16:49 -08:00
|
|
|
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
|
|
|
|
"-std=c++1y",
|
|
|
|
]
|
2016-07-25 06:31:32 -07:00
|
|
|
|
|
|
|
cxx_library(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "yoga",
|
2017-11-21 10:10:30 -08:00
|
|
|
srcs = glob(["yoga/*.cpp"]),
|
2017-02-24 21:40:45 -08:00
|
|
|
header_namespace = "",
|
2017-09-25 10:10:19 -07:00
|
|
|
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
|
|
|
compiler_flags = COMPILER_FLAGS,
|
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
|
|
|
)
|
|
|
|
|
2018-03-01 04:00:28 -08:00
|
|
|
cxx_library(
|
|
|
|
name = "yogafastmath",
|
|
|
|
srcs = glob(["yoga/*.cpp"]),
|
|
|
|
header_namespace = "",
|
|
|
|
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
|
|
|
compiler_flags = COMPILER_FLAGS + ["-ffast-math"],
|
|
|
|
soname = "libyogafastmathcore.$(ext)",
|
|
|
|
tests = [":YogaTests"],
|
|
|
|
visibility = ["PUBLIC"],
|
|
|
|
deps = [
|
|
|
|
yoga_dep("lib/fb:ndklog"),
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2016-07-25 06:31:32 -07:00
|
|
|
cxx_test(
|
2017-02-24 21:40:45 -08:00
|
|
|
name = "YogaTests",
|
|
|
|
srcs = glob(["tests/*.cpp"]),
|
|
|
|
compiler_flags = TEST_COMPILER_FLAGS,
|
|
|
|
contacts = ["emilsj@fb.com"],
|
|
|
|
visibility = ["PUBLIC"],
|
|
|
|
deps = [
|
|
|
|
":yoga",
|
|
|
|
GTEST_TARGET,
|
|
|
|
],
|
2016-07-25 06:31:32 -07:00
|
|
|
)
|