Skip to content

Commit

Permalink
Refactor tvos config, cpp20 config
Browse files Browse the repository at this point in the history
Change-Id: I898f97286bc15229b8c8ce0f9670614ff0d4d274
  • Loading branch information
niranjanyardi committed Mar 25, 2024
1 parent 681d441 commit 07292ef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 12 deletions.
21 changes: 21 additions & 0 deletions starboard/build/config/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -252,4 +252,25 @@ config("default_cpp_standard") {
if (is_host_win && !sb_is_modular) {
cflags = [ "/std:c++17" ]
}

if (is_apple) {
cflags_cc = [ "-std=gnu++17" ]
cflags_objcc = [ "-std=gnu++17" ]
}
}

config("cpp20_supported_config") {
if ((sb_is_modular && current_toolchain == cobalt_toolchain) || is_android) {
cflags_cc = [ "-std=c++20" ]
}

# These flags apply to non-modular windows platforms which includes win32, xb1.
if (is_host_win && !sb_is_modular) {
cflags = [ "/std:c++20" ]
}

if (is_apple) {
cflags_cc = [ "-std=gnu++20" ]
cflags_objcc = [ "-std=gnu++20" ]
}
}
2 changes: 0 additions & 2 deletions starboard/build/config/mac/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@ config("host") {

config("common") {
arflags = [ "-no_warning_for_no_symbols" ]
cflags_cc = [ "-std=gnu++17" ]
cflags_objcc = [ "-std=gnu++17" ]
cflags = [ "-fno-common" ]
asmflags = [ "-fno-common" ]
ldflags = [ "-fno-common" ]
Expand Down
11 changes: 1 addition & 10 deletions starboard/nplb/compiler_compliance/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ if (sb_enable_cpp20_audit) {
# We do this to ensure the -std=c++20 flag is added after any other -std flag
# so it overrides any other one.
group("cpp20_supported_config_shim") {
public_configs = [ ":cpp20_supported_config" ]
}

config("cpp20_supported_config") {
# These flags apply to non-modular windows platforms which includes win32, xb1.
if (is_host_win && !sb_is_modular) {
cflags_cc = [ "/std:c++20" ]
} else {
cflags_cc = [ "-std=c++20" ]
}
public_configs = [ "//starboard/build/config:cpp20_supported_config" ]
}
}

0 comments on commit 07292ef

Please sign in to comment.