| # Copyright 2017 The Cobalt Authors. All Rights Reserved. |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| import("//starboard/build/config/fastbuild.gni") |
| import("//starboard/build/delegated_config.gni") |
| |
| # ============================================================================= |
| # DEFAULT COMPILER CONFIGS |
| # ============================================================================= |
| |
| config("compiler_defaults") { |
| cflags = [ |
| # We'll pretend not to be Linux, but Starboard instead. |
| "-U__linux__", |
| "-Werror", |
| "-fcolor-diagnostics", |
| # Default visibility to hidden, to enable dead stripping. |
| "-fvisibility=hidden", |
| # Warn for implicit type conversions that may change a value. |
| "-Wconversion", |
| "-Wno-c++11-compat", |
| # This (rightfully) complains about "override", which we use heavily. |
| "-Wno-c++11-extensions", |
| # Warns on switches on enums that cover all enum values but also contain a |
| # default: branch. Chrome is full of that. |
| "-Wno-covered-switch-default", |
| # protobuf uses hash_map. |
| "-Wno-deprecated", |
| "-fno-exceptions", |
| # Don't warn about the "struct foo f = {0};" initialization pattern. |
| "-Wno-missing-field-initializers", |
| # Do not warn for implicit sign conversions. |
| "-Wno-sign-conversion", |
| "-fno-strict-aliasing", # See http://crbug.com/32204 |
| # TODO(pkasting): In C++11 this is legal, so this should be removed when we |
| # change to that. (This is also why we don't bother fixing all these cases |
| # today.) |
| "-Wno-unnamed-type-template-args", |
| # Triggered by the COMPILE_ASSERT macro. |
| "-Wno-unused-local-typedef", |
| # Do not warn if a function or variable cannot be implicitly |
| # instantiated. |
| "-Wno-undefined-var-template", |
| ] |
| |
| defines = [ |
| "__STDC_FORMAT_MACROS", |
| ] |
| |
| cflags_cc = [ |
| "-std=gnu++11", |
| ] |
| } |
| |
| config("compiler_defaults_debug") { |
| cflags = [] |
| if (!cobalt_use_fastbuild) { |
| cflags += [ "-g" ] |
| } |
| } |
| |
| config("compiler_defaults_devel") { |
| cflags = [] |
| if (!cobalt_use_fastbuild) { |
| cflags += [ "-g" ] |
| } |
| } |
| |
| config("compiler_defaults_qa") { |
| cflags = [ |
| "-gline-tables-only", |
| ] |
| } |
| |
| config("compiler_defaults_gold") { |
| cflags = [ |
| "-gline-tables-only", |
| ] |
| } |
| |
| # ============================================================================= |
| # DELEGATED CONFIGS |
| # ============================================================================= |
| |
| config("pedantic_warnings") { |
| cflags = [ |
| "-Wall", |
| "-Wextra", |
| "-Wunreachable-code", |
| ] |
| } |
| |
| config("no_pedantic_warnings") { |
| cflags = [ |
| # "this" pointer cannot be NULL...pointer may be assumed |
| # to always convert to true. |
| "-Wno-undefined-bool-conversion", |
| # Skia doesn't use overrides. |
| "-Wno-inconsistent-missing-override", |
| # Do not warn about unused function params. |
| "-Wno-unused-parameter", |
| # Do not warn for implicit type conversions that may change a value. |
| "-Wno-conversion", |
| # shifting a negative signed value is undefined |
| "-Wno-shift-negative-value", |
| # Width of bit-field exceeds width of its type- value will be truncated |
| "-Wno-bitfield-width", |
| ] |
| } |
| |
| |
| delegated_config("optimizations") { |
| path = "//starboard/build/toolchain/linux/config" |
| prefixes = [ "no", "debuggable", "full" ] |
| generate_default = false |
| } |
| |
| config("default_optimizations") { |
| if (cobalt_config == "debug") { |
| configs = [ ":no_optimizations" ] |
| } else { |
| configs = [ ":debuggable_optimizations" ] |
| } |
| } |
| |
| |
| delegated_config("rtti") { |
| path = "//starboard/build/toolchain/linux/config" |
| generate_default = false |
| } |
| |
| config("default_rtti") { |
| if (cobalt_config == "debug" || cobalt_config == "devel") { |
| configs = [ ":rtti" ] |
| } else { |
| configs = [ ":no_rtti" ] |
| } |
| } |
| |
| |
| config("wexit_time_destructors") { |
| configs = [ "//starboard/build/toolchain/linux/config:wexit_time_destructors" ] |
| } |
| |
| # ============================================================================= |
| # starboard_platform TARGET |
| # ============================================================================= |
| |
| static_library("starboard_platform") { |
| sources = [ |
| "//starboard/shared/starboard/application.cc", |
| "//starboard/shared/starboard/command_line.cc", |
| "//starboard/shared/starboard/command_line.h", |
| "//starboard/shared/starboard/event_cancel.cc", |
| "//starboard/shared/starboard/event_schedule.cc", |
| "//starboard/shared/starboard/file_mode_string_to_flags.cc", |
| "//starboard/shared/starboard/log_message.cc", |
| "//starboard/shared/starboard/player/filter/stub_audio_decoder.cc", |
| "//starboard/shared/starboard/player/filter/stub_audio_decoder.h", |
| "//starboard/shared/starboard/player/filter/stub_player_components_impl.cc", |
| "//starboard/shared/starboard/player/filter/stub_video_decoder.cc", |
| "//starboard/shared/starboard/player/filter/stub_video_decoder.h", |
| "//starboard/shared/starboard/queue_application.cc", |
| "//starboard/shared/stub/accessibility_get_caption_settings.cc", |
| "//starboard/shared/stub/accessibility_get_display_settings.cc", |
| "//starboard/shared/stub/accessibility_get_text_to_speech_settings.cc", |
| "//starboard/shared/stub/atomic_public.h", |
| "//starboard/shared/stub/audio_sink_create.cc", |
| "//starboard/shared/stub/audio_sink_destroy.cc", |
| "//starboard/shared/stub/audio_sink_get_max_channels.cc", |
| "//starboard/shared/stub/audio_sink_get_nearest_supported_sample_frequency.cc", |
| "//starboard/shared/stub/audio_sink_is_audio_frame_storage_type_supported.cc", |
| "//starboard/shared/stub/audio_sink_is_audio_sample_type_supported.cc", |
| "//starboard/shared/stub/audio_sink_is_valid.cc", |
| "//starboard/shared/stub/byte_swap.cc", |
| "//starboard/shared/stub/character_is_alphanumeric.cc", |
| "//starboard/shared/stub/character_is_digit.cc", |
| "//starboard/shared/stub/character_is_hex_digit.cc", |
| "//starboard/shared/stub/character_is_space.cc", |
| "//starboard/shared/stub/character_is_upper.cc", |
| "//starboard/shared/stub/character_to_lower.cc", |
| "//starboard/shared/stub/character_to_upper.cc", |
| "//starboard/shared/stub/condition_variable_broadcast.cc", |
| "//starboard/shared/stub/condition_variable_create.cc", |
| "//starboard/shared/stub/condition_variable_destroy.cc", |
| "//starboard/shared/stub/condition_variable_signal.cc", |
| "//starboard/shared/stub/condition_variable_wait.cc", |
| "//starboard/shared/stub/condition_variable_wait_timed.cc", |
| "//starboard/shared/stub/cryptography_create_transformer.cc", |
| "//starboard/shared/stub/cryptography_destroy_transformer.cc", |
| "//starboard/shared/stub/cryptography_get_tag.cc", |
| "//starboard/shared/stub/cryptography_set_authenticated_data.cc", |
| "//starboard/shared/stub/cryptography_set_initialization_vector.cc", |
| "//starboard/shared/stub/cryptography_transform.cc", |
| "//starboard/shared/stub/directory_can_open.cc", |
| "//starboard/shared/stub/directory_close.cc", |
| "//starboard/shared/stub/directory_create.cc", |
| "//starboard/shared/stub/directory_get_next.cc", |
| "//starboard/shared/stub/directory_open.cc", |
| "//starboard/shared/stub/double_absolute.cc", |
| "//starboard/shared/stub/double_exponent.cc", |
| "//starboard/shared/stub/double_floor.cc", |
| "//starboard/shared/stub/double_is_finite.cc", |
| "//starboard/shared/stub/double_is_nan.cc", |
| "//starboard/shared/stub/drm_close_session.cc", |
| "//starboard/shared/stub/drm_create_system.cc", |
| "//starboard/shared/stub/drm_destroy_system.cc", |
| "//starboard/shared/stub/drm_generate_session_update_request.cc", |
| "//starboard/shared/stub/drm_is_server_certificate_updatable.cc", |
| "//starboard/shared/stub/drm_system_internal.h", |
| "//starboard/shared/stub/drm_update_server_certificate.cc", |
| "//starboard/shared/stub/drm_update_session.cc", |
| "//starboard/shared/stub/file_atomic_replace.cc", |
| "//starboard/shared/stub/file_can_open.cc", |
| "//starboard/shared/stub/file_close.cc", |
| "//starboard/shared/stub/file_delete.cc", |
| "//starboard/shared/stub/file_exists.cc", |
| "//starboard/shared/stub/file_flush.cc", |
| "//starboard/shared/stub/file_get_info.cc", |
| "//starboard/shared/stub/file_get_path_info.cc", |
| "//starboard/shared/stub/file_open.cc", |
| "//starboard/shared/stub/file_read.cc", |
| "//starboard/shared/stub/file_seek.cc", |
| "//starboard/shared/stub/file_truncate.cc", |
| "//starboard/shared/stub/file_write.cc", |
| "//starboard/shared/stub/log.cc", |
| "//starboard/shared/stub/log_flush.cc", |
| "//starboard/shared/stub/log_format.cc", |
| "//starboard/shared/stub/log_is_tty.cc", |
| "//starboard/shared/stub/log_raw.cc", |
| "//starboard/shared/stub/log_raw_dump_stack.cc", |
| "//starboard/shared/stub/log_raw_format.cc", |
| "//starboard/shared/stub/media_can_play_mime_and_key_system.cc", |
| "//starboard/shared/stub/media_get_audio_configuration.cc", |
| "//starboard/shared/stub/media_get_audio_output_count.cc", |
| "//starboard/shared/stub/media_is_audio_supported.cc", |
| "//starboard/shared/stub/media_is_output_protected.cc", |
| "//starboard/shared/stub/media_is_supported.cc", |
| "//starboard/shared/stub/media_is_transfer_characteristics_supported.cc", |
| "//starboard/shared/stub/media_is_video_supported.cc", |
| "//starboard/shared/stub/media_set_output_protection.cc", |
| "//starboard/shared/stub/memory_allocate_aligned_unchecked.cc", |
| "//starboard/shared/stub/memory_allocate_unchecked.cc", |
| "//starboard/shared/stub/memory_compare.cc", |
| "//starboard/shared/stub/memory_copy.cc", |
| "//starboard/shared/stub/memory_find_byte.cc", |
| "//starboard/shared/stub/memory_flush.cc", |
| "//starboard/shared/stub/memory_free.cc", |
| "//starboard/shared/stub/memory_free_aligned.cc", |
| "//starboard/shared/stub/memory_get_stack_bounds.cc", |
| "//starboard/shared/stub/memory_map.cc", |
| "//starboard/shared/stub/memory_move.cc", |
| "//starboard/shared/stub/memory_reallocate_unchecked.cc", |
| "//starboard/shared/stub/memory_set.cc", |
| "//starboard/shared/stub/memory_unmap.cc", |
| "//starboard/shared/stub/microphone_close.cc", |
| "//starboard/shared/stub/microphone_create.cc", |
| "//starboard/shared/stub/microphone_destroy.cc", |
| "//starboard/shared/stub/microphone_get_available.cc", |
| "//starboard/shared/stub/microphone_is_sample_rate_supported.cc", |
| "//starboard/shared/stub/microphone_open.cc", |
| "//starboard/shared/stub/microphone_read.cc", |
| "//starboard/shared/stub/mutex_acquire.cc", |
| "//starboard/shared/stub/mutex_acquire_try.cc", |
| "//starboard/shared/stub/mutex_create.cc", |
| "//starboard/shared/stub/mutex_destroy.cc", |
| "//starboard/shared/stub/mutex_release.cc", |
| "//starboard/shared/stub/once.cc", |
| "//starboard/shared/stub/player_create.cc", |
| "//starboard/shared/stub/player_destroy.cc", |
| "//starboard/shared/stub/player_get_current_frame.cc", |
| "//starboard/shared/stub/player_get_info.cc", |
| "//starboard/shared/stub/player_output_mode_supported.cc", |
| "//starboard/shared/stub/player_seek.cc", |
| "//starboard/shared/stub/player_set_bounds.cc", |
| "//starboard/shared/stub/player_set_playback_rate.cc", |
| "//starboard/shared/stub/player_set_volume.cc", |
| "//starboard/shared/stub/player_write_end_of_stream.cc", |
| "//starboard/shared/stub/player_write_sample.cc", |
| "//starboard/shared/stub/socket_accept.cc", |
| "//starboard/shared/stub/socket_bind.cc", |
| "//starboard/shared/stub/socket_clear_last_error.cc", |
| "//starboard/shared/stub/socket_connect.cc", |
| "//starboard/shared/stub/socket_create.cc", |
| "//starboard/shared/stub/socket_destroy.cc", |
| "//starboard/shared/stub/socket_free_resolution.cc", |
| "//starboard/shared/stub/socket_get_interface_address.cc", |
| "//starboard/shared/stub/socket_get_last_error.cc", |
| "//starboard/shared/stub/socket_get_local_address.cc", |
| "//starboard/shared/stub/socket_is_connected.cc", |
| "//starboard/shared/stub/socket_is_connected_and_idle.cc", |
| "//starboard/shared/stub/socket_join_multicast_group.cc", |
| "//starboard/shared/stub/socket_listen.cc", |
| "//starboard/shared/stub/socket_receive_from.cc", |
| "//starboard/shared/stub/socket_resolve.cc", |
| "//starboard/shared/stub/socket_send_to.cc", |
| "//starboard/shared/stub/socket_set_broadcast.cc", |
| "//starboard/shared/stub/socket_set_receive_buffer_size.cc", |
| "//starboard/shared/stub/socket_set_reuse_address.cc", |
| "//starboard/shared/stub/socket_set_send_buffer_size.cc", |
| "//starboard/shared/stub/socket_set_tcp_keep_alive.cc", |
| "//starboard/shared/stub/socket_set_tcp_no_delay.cc", |
| "//starboard/shared/stub/socket_set_tcp_window_scaling.cc", |
| "//starboard/shared/stub/socket_waiter_add.cc", |
| "//starboard/shared/stub/socket_waiter_create.cc", |
| "//starboard/shared/stub/socket_waiter_destroy.cc", |
| "//starboard/shared/stub/socket_waiter_remove.cc", |
| "//starboard/shared/stub/socket_waiter_wait.cc", |
| "//starboard/shared/stub/socket_waiter_wait_timed.cc", |
| "//starboard/shared/stub/socket_waiter_wake_up.cc", |
| "//starboard/shared/stub/speech_recognizer_cancel.cc", |
| "//starboard/shared/stub/speech_recognizer_create.cc", |
| "//starboard/shared/stub/speech_recognizer_destroy.cc", |
| "//starboard/shared/stub/speech_recognizer_is_supported.cc", |
| "//starboard/shared/stub/speech_recognizer_start.cc", |
| "//starboard/shared/stub/speech_recognizer_stop.cc", |
| "//starboard/shared/stub/speech_synthesis_cancel.cc", |
| "//starboard/shared/stub/speech_synthesis_is_supported.cc", |
| "//starboard/shared/stub/speech_synthesis_speak.cc", |
| "//starboard/shared/stub/storage_close_record.cc", |
| "//starboard/shared/stub/storage_delete_record.cc", |
| "//starboard/shared/stub/storage_get_record_size.cc", |
| "//starboard/shared/stub/storage_open_record.cc", |
| "//starboard/shared/stub/storage_read_record.cc", |
| "//starboard/shared/stub/storage_write_record.cc", |
| "//starboard/shared/stub/string_compare.cc", |
| "//starboard/shared/stub/string_compare_all.cc", |
| "//starboard/shared/stub/string_compare_no_case.cc", |
| "//starboard/shared/stub/string_compare_no_case_n.cc", |
| "//starboard/shared/stub/string_compare_wide.cc", |
| "//starboard/shared/stub/string_concat.cc", |
| "//starboard/shared/stub/string_concat_wide.cc", |
| "//starboard/shared/stub/string_copy.cc", |
| "//starboard/shared/stub/string_copy_wide.cc", |
| "//starboard/shared/stub/string_duplicate.cc", |
| "//starboard/shared/stub/string_find_character.cc", |
| "//starboard/shared/stub/string_find_last_character.cc", |
| "//starboard/shared/stub/string_find_string.cc", |
| "//starboard/shared/stub/string_format.cc", |
| "//starboard/shared/stub/string_format_wide.cc", |
| "//starboard/shared/stub/string_get_length.cc", |
| "//starboard/shared/stub/string_get_length_wide.cc", |
| "//starboard/shared/stub/string_parse_double.cc", |
| "//starboard/shared/stub/string_parse_signed_integer.cc", |
| "//starboard/shared/stub/string_parse_uint64.cc", |
| "//starboard/shared/stub/string_parse_unsigned_integer.cc", |
| "//starboard/shared/stub/string_scan.cc", |
| "//starboard/shared/stub/system_binary_search.cc", |
| "//starboard/shared/stub/system_break_into_debugger.cc", |
| "//starboard/shared/stub/system_clear_last_error.cc", |
| "//starboard/shared/stub/system_get_connection_type.cc", |
| "//starboard/shared/stub/system_get_device_type.cc", |
| "//starboard/shared/stub/system_get_error_string.cc", |
| "//starboard/shared/stub/system_get_last_error.cc", |
| "//starboard/shared/stub/system_get_locale_id.cc", |
| "//starboard/shared/stub/system_get_number_of_processors.cc", |
| "//starboard/shared/stub/system_get_path.cc", |
| "//starboard/shared/stub/system_get_property.cc", |
| "//starboard/shared/stub/system_get_random_data.cc", |
| "//starboard/shared/stub/system_get_random_uint64.cc", |
| "//starboard/shared/stub/system_get_stack.cc", |
| "//starboard/shared/stub/system_get_total_cpu_memory.cc", |
| "//starboard/shared/stub/system_get_total_gpu_memory.cc", |
| "//starboard/shared/stub/system_get_used_cpu_memory.cc", |
| "//starboard/shared/stub/system_get_used_gpu_memory.cc", |
| "//starboard/shared/stub/system_has_capability.cc", |
| "//starboard/shared/stub/system_hide_splash_screen.cc", |
| "//starboard/shared/stub/system_is_debugger_attached.cc", |
| "//starboard/shared/stub/system_raise_platform_error.cc", |
| "//starboard/shared/stub/system_request_pause.cc", |
| "//starboard/shared/stub/system_request_stop.cc", |
| "//starboard/shared/stub/system_request_suspend.cc", |
| "//starboard/shared/stub/system_request_unpause.cc", |
| "//starboard/shared/stub/system_sort.cc", |
| '//starboard/shared/stub/system_supports_resume.cc', |
| "//starboard/shared/stub/system_symbolize.cc", |
| "//starboard/shared/stub/thread_create.cc", |
| "//starboard/shared/stub/thread_create_local_key.cc", |
| "//starboard/shared/stub/thread_destroy_local_key.cc", |
| "//starboard/shared/stub/thread_detach.cc", |
| "//starboard/shared/stub/thread_get_current.cc", |
| "//starboard/shared/stub/thread_get_id.cc", |
| "//starboard/shared/stub/thread_get_local_value.cc", |
| "//starboard/shared/stub/thread_get_name.cc", |
| "//starboard/shared/stub/thread_is_equal.cc", |
| "//starboard/shared/stub/thread_join.cc", |
| "//starboard/shared/stub/thread_set_local_value.cc", |
| "//starboard/shared/stub/thread_set_name.cc", |
| "//starboard/shared/stub/thread_sleep.cc", |
| "//starboard/shared/stub/thread_types_public.h", |
| "//starboard/shared/stub/thread_yield.cc", |
| "//starboard/shared/stub/time_get_monotonic_now.cc", |
| "//starboard/shared/stub/time_get_monotonic_thread_now.cc", |
| "//starboard/shared/stub/time_get_now.cc", |
| "//starboard/shared/posix/time_is_time_thread_now_supported.cc", |
| "//starboard/shared/stub/time_zone_get_current.cc", |
| "//starboard/shared/stub/time_zone_get_dst_name.cc", |
| "//starboard/shared/stub/time_zone_get_name.cc", |
| "//starboard/shared/stub/user_get_current.cc", |
| "//starboard/shared/stub/user_get_property.cc", |
| "//starboard/shared/stub/user_get_signed_in.cc", |
| "//starboard/shared/stub/window_create.cc", |
| "//starboard/shared/stub/window_destroy.cc", |
| "//starboard/shared/stub/window_get_platform_handle.cc", |
| "//starboard/shared/stub/window_get_size.cc", |
| "//starboard/shared/stub/window_set_default_options.cc", |
| "application_stub.cc", |
| "application_stub.h", |
| "atomic_public.h", |
| "main.cc", |
| "thread_types_public.h", |
| ] |
| |
| # Include private stubs, if present. |
| private_sources = exec_script("//starboard/tools/find_private_files.py", |
| [ |
| rebase_path("//", root_build_dir), |
| "shared/stub/*.cc", |
| ], |
| "list lines", |
| [ "//starboard/private/shared/stub" ]) |
| sources += rebase_path(private_sources, ".", root_build_dir) |
| |
| defines = [ "STARBOARD_IMPLEMENTATION" ] |
| } |