2017-05-12 20:50:37 +03:00
|
|
|
# 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.
|
|
|
|
|
2017-05-19 22:55:15 +03:00
|
|
|
import("//build/config/fuchsia/config.gni")
|
2017-05-12 20:50:37 +03:00
|
|
|
import("//build/config/sysroot.gni")
|
|
|
|
|
|
|
|
assert(is_fuchsia)
|
|
|
|
assert(is_posix)
|
|
|
|
|
|
|
|
config("compiler") {
|
|
|
|
defines = [ "SYSROOT_VERSION=$sysroot_version" ]
|
|
|
|
cflags = []
|
|
|
|
ldflags = []
|
|
|
|
if (current_cpu == "arm64") {
|
|
|
|
cflags += [ "--target=aarch64-fuchsia" ]
|
|
|
|
ldflags += [ "--target=aarch64-fuchsia" ]
|
|
|
|
} else if (current_cpu == "x64") {
|
|
|
|
cflags += [ "--target=x86_64-fuchsia" ]
|
|
|
|
ldflags += [ "--target=x86_64-fuchsia" ]
|
|
|
|
} else {
|
|
|
|
assert(false, "Unsupported architecture")
|
|
|
|
}
|
|
|
|
asmflags = cflags
|
|
|
|
|
2017-05-19 22:55:15 +03:00
|
|
|
# TODO(thakis): Once Fuchsia's libclang_rt.builtin no longer has upstream
|
|
|
|
# patches, we might want to make tools/clang/scripts/update.py build it
|
|
|
|
# and bundle it with the clang package instead of using the library from
|
|
|
|
# the SDK, https://crbug.com/724204
|
|
|
|
ldflags += [
|
|
|
|
"-resource-dir",
|
|
|
|
rebase_path(fuchsia_sdk, root_build_dir) + "/toolchain_libs/clang/5.0.0",
|
|
|
|
]
|
|
|
|
|
2017-05-12 20:50:37 +03:00
|
|
|
libs = [
|
|
|
|
"mxio",
|
|
|
|
"magenta",
|
|
|
|
"unwind",
|
|
|
|
]
|
|
|
|
}
|