blob: bbcf9932f55787cba510927579898bb0391ac3e4 [file] [log] [blame]
# Copyright 2023 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/os_definitions.gni")
declare_args() {
starboard_target_type = ""
starboard_shared_library_extension = "so.${sb_api_version}"
}
if (starboard_target_type == "") {
if (sb_is_modular && !sb_is_evergreen) {
starboard_target_type = "shared_library"
} else {
starboard_target_type = "group"
}
}
template("starboard_platform_target") {
target_type = starboard_target_type
if (defined(invoker.target_type)) {
target_type = invoker.target_type
}
target(target_type, target_name) {
forward_variables_from(invoker, [ "extra_configs" ])
if (defined(invoker.extra_configs)) {
configs += extra_configs
}
if (target_type == "shared_library") {
build_loader = false
if (!is_host_win) {
output_extension = starboard_shared_library_extension
}
}
public_deps = [
"//starboard/client_porting/cwrappers",
"//starboard/client_porting/eztime",
"//starboard/common",
"//starboard/egl_and_gles",
]
if (sb_is_evergreen_compatible &&
current_toolchain == starboard_toolchain) {
public_deps += [ "//third_party/crashpad/wrapper" ]
} else {
public_deps += [ "//third_party/crashpad/wrapper:wrapper_stub" ]
}
if (!sb_is_evergreen) {
public_deps += [ "//$starboard_path:starboard_platform" ]
}
if (sb_is_modular) {
# For modular builds (including Evergreen), include POSIX ABI wrappers that
# handle cross-compatibility with musl-based Cobalt code.
public_deps +=
[ "//starboard/shared/modular:starboard_layer_posix_abi_wrappers" ]
}
}
}