diff options
-rw-r--r-- | BUILD.gn | 2 | ||||
-rw-r--r-- | api/BUILD.gn | 4 | ||||
-rw-r--r-- | api/impl/presentation/presentation_controller.cc | 2 | ||||
-rw-r--r-- | api/public/BUILD.gn | 5 | ||||
-rw-r--r-- | base/BUILD.gn | 9 | ||||
-rw-r--r-- | discovery/mdns/BUILD.gn | 4 | ||||
-rw-r--r-- | msgs/BUILD.gn | 2 | ||||
-rw-r--r-- | platform/BUILD.gn | 6 | ||||
-rw-r--r-- | streaming/cast/BUILD.gn | 17 | ||||
-rw-r--r-- | third_party/boringssl/BUILD.gn | 115 | ||||
-rw-r--r-- | third_party/googletest/BUILD.gn | 26 | ||||
-rw-r--r-- | tools/cddl/cddl.py | 3 | ||||
-rw-r--r-- | tools/cddl/logging.h | 9 |
13 files changed, 127 insertions, 77 deletions
@@ -49,7 +49,7 @@ executable("openscreen_unittests") { "sample:hello_unittests", "streaming/cast:cast_unittests", "third_party/abseil", - "//third_party/googletest:gtest_main", + "third_party/googletest:gtest_main", ] } diff --git a/api/BUILD.gn b/api/BUILD.gn index d9dbf0b7..c44e8c4d 100644 --- a/api/BUILD.gn +++ b/api/BUILD.gn @@ -45,12 +45,12 @@ source_set("api_unittests") { deps = [ ":api", "../third_party/abseil", + "../third_party/googletest:gmock", + "../third_party/googletest:gtest", "impl/quic:test_support", "impl/testing", "impl/testing:fakes_unittests", "public:test_support", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest", ] configs += [ "..:root_config_overrides" ] diff --git a/api/impl/presentation/presentation_controller.cc b/api/impl/presentation/presentation_controller.cc index 6f0673bc..74098674 100644 --- a/api/impl/presentation/presentation_controller.cc +++ b/api/impl/presentation/presentation_controller.cc @@ -29,7 +29,7 @@ namespace presentation { static constexpr MessageDecodingFunction<ResponseMsgType> kDecoder = \ &msgs::DecodePresentation##base_name##Response; \ static constexpr msgs::Type kResponseType = \ - msgs::Type::kPresentation##base_name##Response; + msgs::Type::kPresentation##base_name##Response struct StartRequest { DECLARE_MSG_REQUEST_RESPONSE(Start); diff --git a/api/public/BUILD.gn b/api/public/BUILD.gn index a6894a46..b74d8ad0 100644 --- a/api/public/BUILD.gn +++ b/api/public/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build_overrides/build.gni") + source_set("api") { sources = [ "client_config.cc", @@ -42,6 +44,9 @@ source_set("api") { "../../base", "../../platform", ] + if (build_with_chromium) { + configs -= [ "//build/config/compiler:default_include_dirs" ] + } configs += [ "../..:root_config_overrides" ] } diff --git a/base/BUILD.gn b/base/BUILD.gn index daf00a4b..f188ae96 100644 --- a/base/BUILD.gn +++ b/base/BUILD.gn @@ -2,6 +2,8 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build_overrides/build.gni") + source_set("base") { sources = [ "big_endian.h", @@ -40,8 +42,11 @@ source_set("base_unittests") { deps = [ ":base", "../third_party/abseil", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest", + "../third_party/googletest:gmock", + "../third_party/googletest:gtest", ] + if (build_with_chromium) { + configs -= [ "//build/config/compiler:default_include_dirs" ] + } configs += [ "..:root_config_overrides" ] } diff --git a/discovery/mdns/BUILD.gn b/discovery/mdns/BUILD.gn index 76590be9..4046ac79 100644 --- a/discovery/mdns/BUILD.gn +++ b/discovery/mdns/BUILD.gn @@ -28,8 +28,8 @@ source_set("mdns_unittests") { deps = [ ":mdns_interface", - "//third_party/googletest:gmock", - "//third_party/googletest:gtest", + "../../third_party/googletest:gmock", + "../../third_party/googletest:gtest", ] configs += [ "../..:root_config_overrides" ] diff --git a/msgs/BUILD.gn b/msgs/BUILD.gn index d744be21..99276de0 100644 --- a/msgs/BUILD.gn +++ b/msgs/BUILD.gn @@ -64,7 +64,7 @@ source_set("unittests") { deps = [ ":msgs", - "//third_party/googletest:gtest", + "../third_party/googletest:gtest", ] configs += [ "..:root_config_overrides" ] } diff --git a/platform/BUILD.gn b/platform/BUILD.gn index 6d28f758..2137718b 100644 --- a/platform/BUILD.gn +++ b/platform/BUILD.gn @@ -18,8 +18,6 @@ source_set("platform") { "api/task_runner.h", "api/task_runner_factory.h", "api/time.h", - "base/event_loop.cc", - "base/event_loop.h", "base/time.cc", ] @@ -36,6 +34,8 @@ source_set("platform") { public_deps += [ "//base" ] } else { # !build_with_chromium sources += [ + "base/event_loop.cc", + "base/event_loop.h", "base/logging.cc", "base/task_runner_factory.cc", "base/task_runner_impl.cc", @@ -96,7 +96,7 @@ source_set("platform_unittests") { deps = [ ":platform", - "//third_party/googletest:gtest", + "../third_party/googletest:gtest", ] configs += [ "..:root_config_overrides" ] diff --git a/streaming/cast/BUILD.gn b/streaming/cast/BUILD.gn index 83f7d3c4..b80fa22a 100644 --- a/streaming/cast/BUILD.gn +++ b/streaming/cast/BUILD.gn @@ -24,14 +24,17 @@ source_set("cast") { "ssrc.h", ] + # TODO(btolsch): Here and elsewhere, this begs the question of whether we + # should either change //base to //osp_base (like webrtc) or maybe introduce + # an osp_source_set template (also like webrtc). + if (build_with_chromium) { + configs -= [ "//build/config/compiler:default_include_dirs" ] + } + configs += [ "../..:root_config_overrides" ] public_deps = [ "../../third_party/abseil", + "../../third_party/boringssl", ] - if (build_with_chromium) { - public_deps += [ "//third_party/boringssl" ] - } else { - public_deps += [ "../../third_party/boringssl" ] - } deps = [ "../../platform", @@ -49,6 +52,10 @@ source_set("cast_unittests") { "ssrc_unittest.cc", ] + if (build_with_chromium) { + configs -= [ "//build/config/compiler:default_include_dirs" ] + } + configs += [ "../..:root_config_overrides" ] deps = [ ":cast", "../../third_party/googletest:gtest", diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn index b6935a9d..5c2d5ae8 100644 --- a/third_party/boringssl/BUILD.gn +++ b/third_party/boringssl/BUILD.gn @@ -6,70 +6,79 @@ import("//build_overrides/build.gni") import("BUILD.generated.gni") import("BUILD.generated_tests.gni") -# Config for us and everybody else depending on BoringSSL. -config("external_config") { - include_dirs = [ "src/include" ] -} +if (build_with_chromium) { + group("boringssl") { + public_configs = [ "//build/config/compiler:default_include_dirs" ] + public_deps = [ + "//third_party/boringssl", + ] + } +} else { + # Config for us and everybody else depending on BoringSSL. + config("external_config") { + include_dirs = [ "src/include" ] + } -# Config internal to this build file, shared by boringssl and boringssl_fuzzer. -config("internal_config") { - visibility = [ ":*" ] # Only targets in this file can depend on this. - defines = [ - "BORINGSSL_ALLOW_CXX_RUNTIME", - "BORINGSSL_IMPLEMENTATION", - "BORINGSSL_NO_STATIC_INITIALIZER", - "OPENSSL_SMALL", - ] - cflags_c = [ "-std=c99" ] - defines += [ "_XOPEN_SOURCE=700" ] -} + # Config internal to this build file, shared by boringssl and boringssl_fuzzer. + config("internal_config") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + defines = [ + "BORINGSSL_ALLOW_CXX_RUNTIME", + "BORINGSSL_IMPLEMENTATION", + "BORINGSSL_NO_STATIC_INITIALIZER", + "OPENSSL_SMALL", + ] + cflags_c = [ "-std=c99" ] + defines += [ "_XOPEN_SOURCE=700" ] + } -config("no_asm_config") { - visibility = [ ":*" ] # Only targets in this file can depend on this. - defines = [ "OPENSSL_NO_ASM" ] -} + config("no_asm_config") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + defines = [ "OPENSSL_NO_ASM" ] + } -all_sources = crypto_sources + ssl_sources -all_headers = crypto_headers + ssl_headers + all_sources = crypto_sources + ssl_sources + all_headers = crypto_headers + ssl_headers -# This has no sources on some platforms so must be a source_set. -source_set("boringssl_asm") { - visibility = [ ":*" ] # Only targets in this file can depend on this. + # This has no sources on some platforms so must be a source_set. + source_set("boringssl_asm") { + visibility = [ ":*" ] # Only targets in this file can depend on this. - sources = [] - asmflags = [] + sources = [] + asmflags = [] - if (is_linux) { - if (current_cpu == "x64") { - sources += crypto_sources_linux_x86_64 - } else if (current_cpu == "x86") { - sources += crypto_sources_linux_x86 - } else { - public_configs = [ ":no_asm_config" ] - } - } else if (is_mac) { - if (current_cpu == "x64") { - sources += crypto_sources_mac_x86_64 - } else if (current_cpu == "x86") { - sources += crypto_sources_mac_x86 + if (is_linux) { + if (current_cpu == "x64") { + sources += crypto_sources_linux_x86_64 + } else if (current_cpu == "x86") { + sources += crypto_sources_linux_x86 + } else { + public_configs = [ ":no_asm_config" ] + } + } else if (is_mac) { + if (current_cpu == "x64") { + sources += crypto_sources_mac_x86_64 + } else if (current_cpu == "x86") { + sources += crypto_sources_mac_x86 + } else { + public_configs = [ ":no_asm_config" ] + } } else { public_configs = [ ":no_asm_config" ] } - } else { - public_configs = [ ":no_asm_config" ] } -} -source_set("boringssl") { - sources = all_sources - public = all_headers - deps = [ - ":boringssl_asm", - "src/third_party/fiat:fiat_license", - ] + source_set("boringssl") { + sources = all_sources + public = all_headers + deps = [ + ":boringssl_asm", + "src/third_party/fiat:fiat_license", + ] - public_configs = [ ":external_config" ] - configs += [ ":internal_config" ] + public_configs = [ ":external_config" ] + configs += [ ":internal_config" ] - configs -= [ "//build:default_include_dirs" ] + configs -= [ "//build:default_include_dirs" ] + } } diff --git a/third_party/googletest/BUILD.gn b/third_party/googletest/BUILD.gn index b7a718ea..079df859 100644 --- a/third_party/googletest/BUILD.gn +++ b/third_party/googletest/BUILD.gn @@ -4,7 +4,31 @@ import("//build_overrides/build.gni") -if (!build_with_chromium) { +if (build_with_chromium) { + source_set("gmock") { + testonly = true + public_configs = [ "//build/config/compiler:default_include_dirs" ] + public_deps = [ + "//third_party/googletest:gmock", + ] + } + + source_set("gtest") { + testonly = true + public_configs = [ "//build/config/compiler:default_include_dirs" ] + public_deps = [ + "//third_party/googletest:gtest", + ] + } + + source_set("gtest_main") { + testonly = true + public_configs = [ "//build/config/compiler:default_include_dirs" ] + public_deps = [ + "//third_party/googletest:gtest_main", + ] + } +} else { config("gmock_config") { visibility = [ ":*" ] diff --git a/tools/cddl/cddl.py b/tools/cddl/cddl.py index a0290cdb..b9be470f 100644 --- a/tools/cddl/cddl.py +++ b/tools/cddl/cddl.py @@ -77,7 +77,7 @@ def validateCddlInput(cddlFile): def echoAndRunCommand(commandArray, allowFailure, logfile = None): print("\tExecuting Command: '%s'" % " ".join(commandArray)) if logfile != None: - process = subprocess.Popen(commandArray, stdout=logfile) + process = subprocess.Popen(commandArray, stdout=logfile, stderr=logfile) process.wait() logfile.flush() else: @@ -87,7 +87,6 @@ def echoAndRunCommand(commandArray, allowFailure, logfile = None): if returncode != None and returncode != 0: if not allowFailure: sys.exit("\t\tERROR: Command failed with error code: '%i'!" % returncode) - else: print("\t\tWARNING: Command failed with error code: '%i'!" % returncode) diff --git a/tools/cddl/logging.h b/tools/cddl/logging.h index 16133a94..a4fce443 100644 --- a/tools/cddl/logging.h +++ b/tools/cddl/logging.h @@ -81,14 +81,15 @@ class Logger { #elif defined(__GNUC__) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wformat-security" -#endif - asprintf(&str_buffer, message.c_str(), - this->MakePrintable(std::forward<Args>(args))...); +#endif // defined(__clang__) + int byte_count = asprintf(&str_buffer, message.c_str(), + this->MakePrintable(std::forward<Args>(args))...); #if defined(__clang__) #pragma clang diagnostic pop #elif defined(__GNUC__) #pragma GCC diagnostic pop -#endif +#endif // defined(__clang__) + OSP_CHECK_GE(byte_count, 0); stream << str_buffer; free(str_buffer); } |