diff --git a/cobalt/BUILD.gn b/cobalt/BUILD.gn index 4819e94b33758..b800883369937 100644 --- a/cobalt/BUILD.gn +++ b/cobalt/BUILD.gn @@ -16,7 +16,10 @@ group("gn_all") { testonly = true # TODO(b/371589344): Fix android build configs. - deps = [ "//starboard($starboard_toolchain)" ] + deps = [ + "//starboard($starboard_toolchain)", + "//starboard/nplb", + ] if (!is_android) { deps += [ ":cobalt" ] } else { diff --git a/cobalt/docker/linux/Dockerfile b/cobalt/docker/linux/Dockerfile index e69bfa7f34b2e..9534beb6eafbc 100644 --- a/cobalt/docker/linux/Dockerfile +++ b/cobalt/docker/linux/Dockerfile @@ -25,6 +25,7 @@ RUN apt-get update && apt-get install -y \ libpango-1.0-0 \ gcc-multilib \ bzip2 \ + python3-certifi \ && rm -rf /var/lib/apt/lists/* ADD files/sccache /usr/local/bin diff --git a/starboard/BUILD.gn b/starboard/BUILD.gn index eed1457bd1da2..e00e717c5d5e7 100644 --- a/starboard/BUILD.gn +++ b/starboard/BUILD.gn @@ -16,7 +16,7 @@ import("//starboard/build/config/os_definitions.gni") import("//starboard/build/config/starboard_target_type.gni") import("//starboard/contrib/cast/cast.gni") -if (sb_is_modular) { +if (!is_cobalt) { group("gn_all") { testonly = true @@ -225,6 +225,8 @@ source_set("starboard_headers_only") { # TODO: b/374302273 - Fix starboard implementation to not emit these compiler warnings. config("hacky_wnos") { cflags = [ + "-Wno-undefined-internal", + # Disable errors for the warning till the Android NDK r19 is fixed. # The warning is trigger when compiling .c files and complains for # "-stdlib=libc++" which is added by the NDK. diff --git a/starboard/android/shared/BUILD.gn b/starboard/android/shared/BUILD.gn index 10b1859261e84..b6836075e1a11 100644 --- a/starboard/android/shared/BUILD.gn +++ b/starboard/android/shared/BUILD.gn @@ -213,7 +213,6 @@ static_library("starboard_platform") { "log_internal.cc", "log_internal.h", "log_raw.cc", - "main.cc", "max_media_codec_output_buffers_lookup_table.cc", "max_media_codec_output_buffers_lookup_table.h", "media_capabilities_cache.cc", diff --git a/starboard/android/shared/platform_configuration/BUILD.gn b/starboard/android/shared/platform_configuration/BUILD.gn index 54040f7419d84..8c348c4432795 100644 --- a/starboard/android/shared/platform_configuration/BUILD.gn +++ b/starboard/android/shared/platform_configuration/BUILD.gn @@ -23,6 +23,13 @@ config("platform_configuration") { "log", "mediandk", ] + cflags = [ + "-fsigned-char", + + # Ignore warnings in Chromium code related to forcing signed char. + "-Wno-sign-compare", + "-Wno-c++11-narrowing", + ] } config("size") { diff --git a/starboard/common/BUILD.gn b/starboard/common/BUILD.gn index eb6928b34aee0..609ba6375ae71 100644 --- a/starboard/common/BUILD.gn +++ b/starboard/common/BUILD.gn @@ -103,6 +103,7 @@ static_library("file_wrapper") { "file_wrapper.cc", "file_wrapper.h", ] + deps = [ "//starboard:starboard_headers_only" ] } target(gtest_target_type, "common_test") { diff --git a/starboard/common/test_main.cc b/starboard/common/test_main.cc index 375ff3a846b8e..94da2f171f557 100644 --- a/starboard/common/test_main.cc +++ b/starboard/common/test_main.cc @@ -12,10 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. +#include "starboard/configuration.h" +#include "testing/gtest/include/gtest/gtest.h" + +#if SB_IS(EVERGREEN) #include "starboard/client_porting/wrap_main/wrap_main.h" #include "starboard/event.h" #include "starboard/system.h" -#include "testing/gtest/include/gtest/gtest.h" namespace { int InitAndRunAllTests(int argc, char** argv) { @@ -26,7 +29,10 @@ int InitAndRunAllTests(int argc, char** argv) { // When we are building Evergreen we need to export SbEventHandle so that the // ELF loader can find and invoke it. -#if SB_IS(MODULAR) -SB_EXPORT -#endif // SB_IS(MODULAR) -STARBOARD_WRAP_SIMPLE_MAIN(InitAndRunAllTests); +SB_EXPORT STARBOARD_WRAP_SIMPLE_MAIN(InitAndRunAllTests); +#else +int main(int argc, char** argv) { + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} +#endif diff --git a/starboard/linux/shared/BUILD.gn b/starboard/linux/shared/BUILD.gn index e7db7e0d4cbb6..526914314dce3 100644 --- a/starboard/linux/shared/BUILD.gn +++ b/starboard/linux/shared/BUILD.gn @@ -228,6 +228,7 @@ static_library("starboard_platform_sources") { "//starboard/shared/starboard/file_storage/storage_read_record.cc", "//starboard/shared/starboard/log_mutex.cc", "//starboard/shared/starboard/log_mutex.h", + "//starboard/shared/starboard/log_raw_dump_stack.cc", "//starboard/shared/starboard/log_raw_format.cc", "//starboard/shared/starboard/media/media_can_play_mime_and_key_system.cc", "//starboard/shared/starboard/media/media_get_audio_buffer_budget.cc", @@ -269,9 +270,6 @@ static_library("starboard_platform_sources") { "//starboard/shared/stub/thread_create_priority.cc", "//starboard/shared/stub/window_get_diagonal_size_in_inches.cc", ] - if (enable_evergreen_code) { - sources += [ "//starboard/shared/starboard/log_raw_dump_stack.cc" ] - } sources += common_player_sources diff --git a/starboard/nplb/BUILD.gn b/starboard/nplb/BUILD.gn index 73d9a13ce1acd..d1e1d97f07c4c 100644 --- a/starboard/nplb/BUILD.gn +++ b/starboard/nplb/BUILD.gn @@ -13,6 +13,7 @@ # limitations under the License. import("//starboard/build/config/os_definitions.gni") +import("//testing/test.gni") declare_args() { sb_enable_cast_codec_tests = false @@ -22,7 +23,18 @@ config("cast_codec_tests") { cflags = [ "ENABLE_CAST_CODEC_TESTS" ] } -target(gtest_target_type, "nplb") { +config("wnos") { + cflags = [ + "-Wno-ignored-qualifiers", + "-Wno-self-assign-overloaded", + "-Wno-pessimizing-move", + "-Wno-unused-local-typedef", + "-Wno-unreachable-code", + "-Wno-unreachable-code-break", + ] +} + +test("nplb") { testonly = true sources = [ @@ -35,11 +47,7 @@ target(gtest_target_type, "nplb") { "//starboard/nplb/sabi/struct_alignment_test.cc", "//starboard/shared/starboard/drm/drm_test_helpers.cc", "//starboard/shared/starboard/drm/drm_test_helpers.h", - "//starboard/testing/fake_graphics_context_provider.cc", - "//starboard/testing/fake_graphics_context_provider.h", "align_test.cc", - "atomic_base_test.cc", - "atomic_test.cc", "audio_sink_create_test.cc", "audio_sink_destroy_test.cc", "audio_sink_get_max_channels_test.cc", @@ -79,11 +87,9 @@ target(gtest_target_type, "nplb") { "drm_create_system_test.cc", "maximum_player_configuration_explorer.cc", "maximum_player_configuration_explorer.h", - "maximum_player_configuration_explorer_test.cc", "media_buffer_test.cc", "media_can_play_mime_and_key_system_test.cc", "media_configuration_test.cc", - "media_set_audio_write_duration_test.cc", "microphone_close_test.cc", "microphone_create_test.cc", "microphone_destroy_test.cc", @@ -91,20 +97,13 @@ target(gtest_target_type, "nplb") { "microphone_is_sample_rate_supported_test.cc", "microphone_open_test.cc", "microphone_read_test.cc", - "multiple_player_test.cc", "murmurhash2_test.cc", "optional_test.cc", - "player_create_test.cc", "player_creation_param_helpers.cc", "player_creation_param_helpers.h", - "player_get_audio_configuration_test.cc", - "player_get_media_time_test.cc", "player_get_preferred_output_mode_test.cc", - "player_test_fixture.cc", - "player_test_fixture.h", "player_test_util.cc", "player_test_util.h", - "player_write_sample_test.cc", "posix_compliance/posix_arpa_inet_test.cc", "posix_compliance/posix_condition_variable_broadcast_test.cc", "posix_compliance/posix_condition_variable_create_test.cc", @@ -185,7 +184,6 @@ target(gtest_target_type, "nplb") { "socket_waiter_destroy_test.cc", "socket_waiter_wake_up_test.cc", "socket_wrapper_test.cc", - "speech_synthesis_basic_test.cc", "storage_close_record_test.cc", "storage_get_record_size_test.cc", "storage_read_record_test.cc", @@ -220,15 +218,35 @@ target(gtest_target_type, "nplb") { "ui_navigation_test.cc", "undefined_behavior_test.cc", "url_player_create_test.cc", - "vertical_video_test.cc", - "window_create_test.cc", - "window_destroy_test.cc", - "window_get_diagonal_size_in_inches_test.cc", - "window_get_platform_handle_test.cc", - "window_get_size_test.cc", ] - configs += [ "//starboard/build/config:starboard_implementation" ] + if (!is_android) { + sources += [ + "//starboard/testing/fake_graphics_context_provider.cc", + "//starboard/testing/fake_graphics_context_provider.h", + "maximum_player_configuration_explorer_test.cc", + "media_set_audio_write_duration_test.cc", + "multiple_player_test.cc", + "player_create_test.cc", + "player_get_audio_configuration_test.cc", + "player_get_media_time_test.cc", + "player_test_fixture.cc", + "player_test_fixture.h", + "player_write_sample_test.cc", + "speech_synthesis_basic_test.cc", + "vertical_video_test.cc", + "window_create_test.cc", + "window_destroy_test.cc", + "window_get_diagonal_size_in_inches_test.cc", + "window_get_platform_handle_test.cc", + "window_get_size_test.cc", + ] + } + + configs += [ + "//starboard/build/config:starboard_implementation", + ":wnos", + ] if (sb_enable_cast_codec_tests) { configs += [ ":cast_codec_tests" ] } @@ -264,7 +282,7 @@ target(gtest_target_type, "nplb") { "//starboard/shared/starboard/player:player_download_test_data", ] - if (is_clang && !is_android) { + if (is_clang) { # signedness_and_size_of_enum_test.cc casts -1 to enum value cflags = [ "-Wno-enum-constexpr-conversion" ] } diff --git a/starboard/nplb/compiler_compliance/BUILD.gn b/starboard/nplb/compiler_compliance/BUILD.gn index 38dcd9fea97aa..f790af98dbc09 100644 --- a/starboard/nplb/compiler_compliance/BUILD.gn +++ b/starboard/nplb/compiler_compliance/BUILD.gn @@ -12,11 +12,25 @@ # See the License for the specific language governing permissions and # limitations under the License. +config("no_unused") { + cflags = [ + "-Wno-unused-variable", + "-Wno-unused-function", + "-Wno-unused-const-variable", + "-Wno-unreachable-code-break", + ] +} + static_library("cpp14_supported") { sources = [ "cpp14_constexpr.cc", "cpp14_initialization.cc", ] + configs += [ + ":no_unused", + "//starboard/build/config:starboard", + "//starboard/build/config/sabi", + ] cflags_cc = [ "-std=c++14" ] deps = [ "//starboard:starboard_group" ] } @@ -24,6 +38,11 @@ static_library("cpp14_supported") { if (sb_enable_cpp17_audit) { static_library("cpp17_supported") { sources = [ "cpp17_support.cc" ] + configs += [ + "//starboard/build/config:starboard", + "//starboard/build/config/sabi", + ":no_unused", + ] deps = [ ":cpp17_supported_config_shim", "//starboard:starboard_group", @@ -44,11 +63,11 @@ if (sb_enable_cpp17_audit) { if (sb_enable_cpp20_audit) { static_library("cpp20_supported") { sources = [ "cpp20_support.cc" ] + configs += [ ":no_unused" ] deps = [ ":cpp20_supported_config_shim", "//starboard:starboard_group", ] - configs -= [ "//starboard/build/config:default_cpp_standard" ] } # We do this to ensure the -std=c++20 flag is added after any other -std flag diff --git a/starboard/nplb/maximum_player_configuration_explorer_test.cc b/starboard/nplb/maximum_player_configuration_explorer_test.cc index ed704c3f05911..2318b6346ae38 100644 --- a/starboard/nplb/maximum_player_configuration_explorer_test.cc +++ b/starboard/nplb/maximum_player_configuration_explorer_test.cc @@ -16,6 +16,7 @@ #include #include +#include "starboard/common/string.h" #include "starboard/nplb/drm_helpers.h" #include "starboard/nplb/maximum_player_configuration_explorer.h" #include "starboard/nplb/player_test_util.h" diff --git a/starboard/nplb/posix_compliance/posix_directory_create_test.cc b/starboard/nplb/posix_compliance/posix_directory_create_test.cc index db8cb81c42ca9..37fca7661e309 100644 --- a/starboard/nplb/posix_compliance/posix_directory_create_test.cc +++ b/starboard/nplb/posix_compliance/posix_directory_create_test.cc @@ -14,6 +14,7 @@ #include +#include "starboard/common/string.h" #include "starboard/configuration_constants.h" #include "starboard/nplb/file_helpers.h" #include "starboard/system.h" diff --git a/starboard/nplb/posix_compliance/posix_directory_get_next_test.cc b/starboard/nplb/posix_compliance/posix_directory_get_next_test.cc index 749b9aedf3518..ba6649051d501 100644 --- a/starboard/nplb/posix_compliance/posix_directory_get_next_test.cc +++ b/starboard/nplb/posix_compliance/posix_directory_get_next_test.cc @@ -19,6 +19,7 @@ #include #include "starboard/common/log.h" +#include "starboard/common/string.h" #include "starboard/configuration.h" #include "starboard/configuration_constants.h" #include "starboard/nplb/file_helpers.h" diff --git a/starboard/nplb/posix_compliance/posix_socket_bind_test.cc b/starboard/nplb/posix_compliance/posix_socket_bind_test.cc index e9aa8853632c1..ae86196ac7b7a 100644 --- a/starboard/nplb/posix_compliance/posix_socket_bind_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_bind_test.cc @@ -15,6 +15,7 @@ // Here we are not trying to do anything fancy, just to really sanity check that // this is hooked up to something. +#include "starboard/common/string.h" #include "starboard/nplb/posix_compliance/posix_socket_helpers.h" namespace starboard { diff --git a/starboard/nplb/posix_compliance/posix_socket_helpers.h b/starboard/nplb/posix_compliance/posix_socket_helpers.h index 5b14126834add..e084c36a4e67e 100644 --- a/starboard/nplb/posix_compliance/posix_socket_helpers.h +++ b/starboard/nplb/posix_compliance/posix_socket_helpers.h @@ -23,6 +23,7 @@ #include #include +#include "starboard/common/log.h" #include "starboard/common/time.h" #include "starboard/nplb/socket_helpers.h" #include "starboard/socket.h" diff --git a/starboard/nplb/posix_compliance/posix_socket_send_test.cc b/starboard/nplb/posix_compliance/posix_socket_send_test.cc index c2c158b5309f8..e3a492c6e1392 100644 --- a/starboard/nplb/posix_compliance/posix_socket_send_test.cc +++ b/starboard/nplb/posix_compliance/posix_socket_send_test.cc @@ -19,6 +19,7 @@ #include #include #include +#include "starboard/common/log.h" #include "starboard/nplb/posix_compliance/posix_socket_helpers.h" #include "starboard/thread.h" diff --git a/starboard/nplb/testdata/file_tests/BUILD.gn b/starboard/nplb/testdata/file_tests/BUILD.gn index bb96507aedbb1..1566e4f321d11 100644 --- a/starboard/nplb/testdata/file_tests/BUILD.gn +++ b/starboard/nplb/testdata/file_tests/BUILD.gn @@ -13,8 +13,6 @@ # limitations under the License. copy("nplb_file_tests_data") { - install_content = true - sources = [ "dir_with_files/file11", "dir_with_files/file12", diff --git a/starboard/shared/ffmpeg/BUILD.gn b/starboard/shared/ffmpeg/BUILD.gn index 95578ba6a8a7e..d4a3be1bcdfbb 100644 --- a/starboard/shared/ffmpeg/BUILD.gn +++ b/starboard/shared/ffmpeg/BUILD.gn @@ -119,5 +119,4 @@ target(gtest_target_type, "ffmpeg_demuxer_test") { "//testing/gmock", "//testing/gtest", ] - data_deps = [ "//media/test/data:media_testdata" ] }