blob: 0a631238677b759694e19941ec300ef03d1473bf [file] [log] [blame]
# Copyright 2021 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.
config("base") {
include_dirs = [ "//" ]
defines = []
if (final_executable_type == "shared_library") {
if (current_toolchain != default_toolchain) {
defines += [ "main=StarboardMain" ]
cflags = [ "-fPIC" ]
}
}
if (is_debug) {
defines += [
"STARBOARD_BUILD_TYPE_DEBUG",
"_DEBUG",
]
}
if (is_devel) {
defines += [
"STARBOARD_BUILD_TYPE_DEVEL",
"_DEBUG",
]
}
if (is_qa) {
defines += [
"STARBOARD_BUILD_TYPE_QA",
"NDEBUG",
]
}
if (is_gold) {
defines += [
"STARBOARD_BUILD_TYPE_GOLD",
"NDEBUG",
]
}
}
config("host") {
if (host_os == "linux") {
ldflags = [ "-pthread" ]
cflags_cc = [ "--std=gnu++14" ]
if (target_cpu == "arm" || target_cpu == "x86") {
cflags = [ "-m32" ]
ldflags += [
"-target",
"i386-unknown-linux-gnu",
"-latomic",
]
}
}
}
config("target") {
cflags = []
}
config("starboard") {
defines = [ "STARBOARD" ]
if (gl_type == "none") {
defines += [ "SB_GN_GL_TYPE_IS_NONE=1" ]
} else {
defines += [ "SB_GN_GL_TYPE_IS_NONE=0" ]
}
if (abort_on_allocation_failure) {
defines += [ "SB_ABORT_ON_ALLOCATION_FAILURE" ]
}
if (sb_allows_memory_tracking) {
defines += [ "STARBOARD_ALLOWS_MEMORY_TRACKING" ]
}
if (sb_enable_lib) {
defines += [ "SB_IS_LIBRARY=1" ]
}
if (sb_evergreen) {
defines += [ "SB_IS_EVERGREEN=1" ]
}
if (sb_evergreen_compatible) {
defines += [ "SB_IS_EVERGREEN_COMPATIBLE=1" ]
}
if (sb_evergreen_compatible_libunwind) {
defines += [ "SB_IS_EVERGREEN_COMPATIBLE_LIBUNWIND=1" ]
}
if (sb_evergreen_compatible_lite) {
defines += [ "SB_IS_EVERGREEN_COMPATIBLE_LITE=1" ]
}
defines += [
"STARBOARD_ATOMIC_INCLUDE=\"$starboard_path/atomic_public.h\"",
"STARBOARD_CONFIGURATION_INCLUDE=\"$starboard_path/configuration_public.h\"",
"STARBOARD_THREAD_TYPES_INCLUDE=\"$starboard_path/thread_types_public.h\"",
]
}