blob: ebcd59c5cedd274664235bd2e193aca9980d4651 [file] [log] [blame]
# Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/sysroot.gni")
assert(is_mac)
config("gcapi_config") {
# gcapi can be bundled with installers of other software, which might run
# on older macOS versions than chrome itself. To not making a dependency on
# gcapi a problem for these installers, make it target a very old version
# of macOS.
min_version = "10.8"
cflags = [
"-isysroot",
rebase_path(sysroot, root_build_dir),
"-mmacosx-version-min=$min_version",
]
ldflags = [
"-isysroot",
rebase_path(sysroot, root_build_dir),
"-mmacosx-version-min=$min_version",
]
}
static_library("gcapi_lib") {
complete_static_lib = true
configs -= [ "//build/config/compiler:thin_archive" ]
sources = [
"gcapi.h",
"gcapi.mm",
]
frameworks = [ "Cocoa.framework" ]
# Don't use runtime_library, to be able to pick a custom mmacosx-version-min.
configs -= [ "//build/config/compiler:runtime_library" ]
configs += [ ":gcapi_config" ]
# no_default_deps has no effect in static_libraries, so set it only below.
}
executable("gcapi_example") {
sources = [ "gcapi_example_client.mm" ]
deps = [ ":gcapi_lib" ]
# Don't use runtime_library, to be able to pick a custom mmacosx-version-min.
configs -= [ "//build/config/compiler:runtime_library" ]
configs += [ ":gcapi_config" ]
# Every executable by default links to a hermetic libc++, so that we can
# guarantee the capability of the standard library. Neither gcapi_lib
# nor gcapi_example contain any significant use of the standard library
# and gcapi_lib is supposed to be redistributable to partners who don't
# want to link our hermetic libc++, so set no_default_deps to not link to
# our hermetic libc++.
no_default_deps = true
}