Skip to content

Commit

Permalink
Rename libstarboard_platform_group.so to libstarboard.so.{sb_api_vers…
Browse files Browse the repository at this point in the history
…ion}

Change-Id: Ide88ea21961487b70803dcab910c5ad8c09d70cc
  • Loading branch information
niranjanyardi committed Sep 3, 2023
1 parent 95649c5 commit 701bd38
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 5 deletions.
3 changes: 2 additions & 1 deletion starboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

import("//starboard/build/config/os_definitions.gni")
import("//starboard/build/config/starboard_target_type.gni")
import("//starboard/contrib/cast/cast.gni")

group("gn_all") {
Expand Down Expand Up @@ -185,6 +184,8 @@ source_set("starboard_headers_only") {
}

if (current_toolchain == starboard_toolchain) {
import("//starboard/build/config/starboard_target_type.gni")

# This is the default 'starboard_platform_target'; use default properties
starboard_platform_target("starboard_platform_group") {
}
Expand Down
15 changes: 14 additions & 1 deletion starboard/build/config/starboard_target_type.gni
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

assert(current_toolchain == starboard_toolchain)
import("//starboard/build/config/os_definitions.gni")
declare_args() {
starboard_target_type = ""
}
Expand All @@ -30,13 +32,24 @@ template("starboard_platform_target") {
target_type = invoker.target_type
}
target(target_type, target_name) {
forward_variables_from(invoker, [ "extra_configs" ])
forward_variables_from(invoker,
[
"extra_configs",
"library_name",
])

if (defined(invoker.extra_configs)) {
configs += extra_configs
}
if (target_type == "shared_library") {
build_loader = false
if (is_linux) {
output_name = "starboard"
output_extension = ".so.${sb_api_version}"
}
if (defined(invoker.library_name)) {
output_name = invoker.library_name
}
}
public_deps = [
"//starboard/client_porting/cwrappers",
Expand Down
6 changes: 4 additions & 2 deletions starboard/contrib/cast/cast_starboard_api/samples/BUILD.gn
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Copyright 2023 The Cobalt Authors. All rights reserved.
import("//starboard/build/config/starboard_target_type.gni")
import("//starboard/contrib/cast/cast.gni")

assert(build_with_separate_cobalt_toolchain && use_contrib_cast)
Expand All @@ -25,13 +24,16 @@ config("default") {
}

if (current_toolchain == starboard_toolchain) {
import("//starboard/build/config/starboard_target_type.gni")
cast_library_name = "cast_starboard_api"
starboard_platform_target("cast_starboard_api") {
extra_configs = [ ":default" ]
library_name = cast_library_name
}

copy("cast_starboard_api_test_data") {
install_content = true
sources = [ "$root_out_dir/libcast_starboard_api.so" ]
sources = [ "$root_out_dir/lib${cast_library_name}.so.${sb_api_version}" ]

# This artifact is consumed by a test built outside of the
# starboard_toolchain; move from `starboard/content/` to `content/`.
Expand Down
6 changes: 5 additions & 1 deletion starboard/raspi/shared/install_target.gni
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ template("install_target") {
source_name = installable_target_name
} else if (invoker.type == "shared_library") {
install_subdir = "lib"
source_name = "lib${installable_target_name}.so"
if (installable_target_name != "starboard_platform_group") {
source_name = "lib${installable_target_name}.so"
} else {
source_name = "libstarboard.so.${sb_api_version}"
}
} else {
assert(false, "You can only install an executable or shared library.")
}
Expand Down

0 comments on commit 701bd38

Please sign in to comment.