Skip to content

Commit

Permalink
Set sb_is_modular, sb_is_evergreen appropriately
Browse files Browse the repository at this point in the history
Change-Id: I1c433ccfca0304488dbec0b85223aa22c148c696
  • Loading branch information
niranjanyardi committed Aug 11, 2023
1 parent 5d61db9 commit e3e7be9
Show file tree
Hide file tree
Showing 17 changed files with 20 additions and 38 deletions.
2 changes: 1 addition & 1 deletion build/toolchain/gcc_toolchain.gni
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ if (enable_resource_allowlist_generation) {
template("gcc_toolchain") {
toolchain(target_name) {
is_starboard_toolchain = target_name == "starboard"
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
not_needed(["is_starboard_toolchain"])
}
assert(defined(invoker.ar), "gcc_toolchain() must specify a \"ar\" value")
Expand Down
3 changes: 0 additions & 3 deletions cobalt/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,5 @@ group("default") {
"//components/update_client",
]
}
if (!build_with_separate_cobalt_toolchain) {
deps += [ "//third_party/llvm-project/libunwind:unwind_evergreen" ]
}
}
}
6 changes: 1 addition & 5 deletions components/update_client/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,6 @@ target(gtest_target_type, "cobalt_slot_management_test") {
"//starboard/loader_app:installation_manager",
"//testing/gmock",
"//testing/gtest",
"//starboard/loader_app"
]
if (build_with_separate_cobalt_toolchain) {
data_deps = [ "//starboard/loader_app($starboard_toolchain)" ]
} else {
deps += [ "//starboard/loader_app" ]
}
}
11 changes: 3 additions & 8 deletions starboard/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ group("gn_all") {
deps += [ "//starboard/benchmark" ]
}

if (build_with_separate_cobalt_toolchain && is_cobalt_toolchain) {
assert(sb_is_modular,
"sb_is_modular should be set when building with cobalt_toolchain")
}

if (!sb_is_evergreen) {
deps += [ "//third_party/lz4_lib:lz4" ]

Expand Down Expand Up @@ -99,7 +94,7 @@ group("starboard") {
if (sb_is_evergreen) {
public_deps += [ "//starboard/elf_loader:sabi_string" ]
}
if (build_with_separate_cobalt_toolchain) {
if (sb_is_modular && !sb_is_evergreen) {
data_deps = [ ":starboard_platform_group($starboard_toolchain)" ]
} else {
public_deps += [ "//third_party/llvm-project/libunwind:unwind_evergreen" ]
Expand All @@ -110,7 +105,7 @@ group("starboard") {
"//starboard/common",
]

if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
if (sb_is_evergreen_compatible) {
public_deps += [ "//third_party/crashpad/wrapper" ]
} else {
Expand Down Expand Up @@ -215,7 +210,7 @@ if (current_toolchain == starboard_toolchain) {

group("starboard_with_main") {
public_deps = [ ":starboard" ]
if (build_with_separate_cobalt_toolchain) {
if (sb_is_modular && !sb_is_evergreen) {
public_deps += [ "//$starboard_path:starboard_platform_with_main" ]
}
}
Expand Down
2 changes: 1 addition & 1 deletion starboard/build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ config("host") {
config("target") {
if (current_toolchain != host_toolchain) {
if (final_executable_type == "shared_library") {
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
# Rewrite main() functions into StarboardMain. TODO: This is a
# hack, it would be better to be more surgical, here.
defines = [ "main=StarboardMain" ]
Expand Down
2 changes: 1 addition & 1 deletion starboard/build/config/starboard_target_type.gni
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ declare_args() {
}

if (starboard_target_type == "") {
if (build_with_separate_cobalt_toolchain) {
if (sb_is_modular && !sb_is_evergreen) {
starboard_target_type = "shared_library"
} else {
starboard_target_type = "group"
Expand Down
2 changes: 1 addition & 1 deletion starboard/evergreen/shared/platform_configuration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ config("platform_configuration") {
"-Wl,-u GetEvergreenSabiString",
]

if (!build_with_separate_cobalt_toolchain) {
if (sb_is_evergreen) {
ldflags += [ "-nostdlib" ]
}
cflags = [
Expand Down
4 changes: 2 additions & 2 deletions starboard/linux/shared/platform_configuration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ config("compiler_flags") {
# Do not warn about unused function params.
"-Wno-unused-parameter",
]
if (build_with_separate_cobalt_toolchain) {
# If we're building modularly, we need visibility.
if (sb_is_modular && !sb_is_evergreen) {
# If we're building with cobalt toolchain and native linker, we need visibility.
cflags += [ "-fvisibility=default" ]
} else {
# Default visibility to hidden, to enable dead stripping.
Expand Down
4 changes: 2 additions & 2 deletions starboard/linux/x64x11/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static_library("starboard_platform") {
check_includes = false

sources = [ "//starboard/linux/x64x11/run_starboard_main.cc" ]
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/main.cc" ]
}

Expand All @@ -28,7 +28,7 @@ static_library("starboard_platform") {
configs += [ "//starboard/build/config:starboard_implementation" ]
}

if (build_with_separate_cobalt_toolchain) {
if (sb_is_modular && !sb_is_evergreen) {
static_library("starboard_platform_with_main") {
check_includes = false
sources = [ "//starboard/linux/x64x11/main.cc" ]
Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/x64x11/clang/3.9/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static_library("starboard_platform") {
check_includes = false

sources = [ "//starboard/linux/x64x11/run_starboard_main.cc" ]
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/main.cc" ]
}

Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/x64x11/egl/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static_library("starboard_platform") {
check_includes = false

sources = [ "//starboard/linux/x64x11/run_starboard_main.cc" ]
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/main.cc" ]
}

Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/x64x11/gcc/6.3/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ static_library("starboard_platform") {
check_includes = false

sources = [ "//starboard/linux/x64x11/run_starboard_main.cc" ]
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/main.cc" ]
}

Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/x64x11/shared/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static_library("starboard_platform_sources") {
"//starboard/shared/x11/window_internal.cc",
]

if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/sanitizer_options.cc" ]
}

Expand Down
6 changes: 3 additions & 3 deletions starboard/linux/x64x11/shared/platform_configuration/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
# limitations under the License.

config("platform_configuration") {
if (current_toolchain == default_toolchain &&
build_with_separate_cobalt_toolchain) {
if (current_toolchain == default_toolchain && sb_is_modular &&
!sb_is_evergreen) {
configs = [ "//starboard/evergreen/x64/platform_configuration" ]
} else {
configs = [
Expand All @@ -28,7 +28,7 @@ config("platform_configuration") {

config("libraries") {
configs = [ "//starboard/linux/shared/platform_configuration:libraries" ]
if (build_with_separate_cobalt_toolchain) {
if (sb_is_modular && !sb_is_evergreen) {
libs = [ "//third_party/libvpx/platforms/linux-x64/libvpx.so.6" ]
ldflags = [ "-Wl,-rpath=" + rebase_path("//") +
"/third_party/libvpx/platforms/linux-x64/" ]
Expand Down
2 changes: 1 addition & 1 deletion starboard/linux/x64x11/skia/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ static_library("starboard_platform") {
"//starboard/linux/x64x11/skia/configuration.h",
"//starboard/linux/x64x11/skia/system_get_extensions.cc",
]
if (!build_with_separate_cobalt_toolchain) {
if (!sb_is_modular || sb_is_evergreen) {
sources += [ "//starboard/linux/x64x11/main.cc" ]
}

Expand Down
3 changes: 0 additions & 3 deletions third_party/llvm-project/libcxx/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,4 @@ static_library("cxx") {
"//third_party/llvm-project/libcxxabi:cxxabi",
"//third_party/musl:c",
]
if (!build_with_separate_cobalt_toolchain) {
deps += [ "//third_party/llvm-project/libunwind:unwind_evergreen" ]
}
}
3 changes: 0 additions & 3 deletions third_party/llvm-project/libcxxabi/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,4 @@ static_library("cxxabi") {
all_dependent_configs = [ ":cxxabi_dependents_config" ]

deps = [ "//third_party/musl:c" ]
if (!build_with_separate_cobalt_toolchain) {
deps += [ "//third_party/llvm-project/libunwind:unwind_evergreen" ]
}
}

0 comments on commit e3e7be9

Please sign in to comment.