Skip to content

Commit

Permalink
Add Cobalt buildflags (#4294)
Browse files Browse the repository at this point in the history
Note these can be changed if we decide on different names for them,
we're just getting something out there that people can use in code
today.

b/374985165
  • Loading branch information
andrewsavage1 authored and borongc committed Nov 27, 2024
1 parent e3d899b commit eba3c66
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions starboard/build/BUILD.gn
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Copyright 2024 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("//build/buildflag_header.gni")
import("//cobalt/build/configs/cobalt.gni")
import("//cobalt/build/configs/variables.gni")

declare_args() {
use_starboard = target_os != "android"
use_starboard_media = is_cobalt
use_evergreen = false
}

# To use these build flags from i.e. "foo.cc", add a dependency from the target
# containing "foo.cc" on this target, then have "foo.cc" include
# "starboard/build/starboard_buildflags.h". After that you can use i.e.
# BUILDFLAG(USE_STARBOARD) in your code.
buildflag_header("starboard_buildflags") {
header = "starboard_buildflags.h"

flags = [
"USE_STARBOARD=$use_starboard",
"USE_STARBOARD_MEDIA=$use_starboard_media",
"USE_EVERGREEN=$use_evergreen",
"IS_COBALT=$is_cobalt",
"IS_MODULAR_BUILD=$sb_is_modular",
]
}

0 comments on commit eba3c66

Please sign in to comment.