mirror of
https://fuchsia.googlesource.com/third_party/pigweed.googlesource.com/pigweed/pigweed
synced 2024-09-20 13:51:05 +00:00
d4e68a17b8
- Switch from std::span to pw::span. - Update the custom compilation in build_id_test.py to pull in pw::span and its dependencies rather than std::span. Change-Id: I70dc17fef4033eb7996305ee961b179430204977 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/98263 Reviewed-by: Armando Montanez <amontanez@google.com> Pigweed-Auto-Submit: Wyatt Hepler <hepler@google.com> Commit-Queue: Wyatt Hepler <hepler@google.com>
76 lines
2.2 KiB
Plaintext
76 lines
2.2 KiB
Plaintext
# Copyright 2021 The Pigweed Authors
|
|
#
|
|
# 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
|
|
#
|
|
# https://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_overrides/pigweed.gni")
|
|
|
|
import("$dir_pw_build/target_types.gni")
|
|
import("$dir_pw_docgen/docs.gni")
|
|
|
|
config("linker_script") {
|
|
inputs = [ "build_id_linker_snippet.ld" ]
|
|
|
|
# Automatically add the gnu build ID linker sections when building for Linux.
|
|
# macOS and Windows executables are not supported, and embedded targets must
|
|
# manually add the snippet to their linker script in a read-only section.
|
|
if (current_os == "linux") {
|
|
# When building for Linux, the linker provides a default linker script.
|
|
# The add_build_id_to_default_script.ld wrapper includes the
|
|
# build_id_linker_snippet.ld script in a way that appends to the the
|
|
# default linker script instead of overriding it.
|
|
ldflags = [
|
|
"-T",
|
|
rebase_path("add_build_id_to_default_script.ld", root_build_dir),
|
|
]
|
|
lib_dirs = [ "." ]
|
|
|
|
inputs += [ "add_build_id_to_default_script.ld" ]
|
|
}
|
|
visibility = [ ":*" ]
|
|
}
|
|
|
|
config("gnu_build_id") {
|
|
ldflags = [ "-Wl,--build-id=sha1" ]
|
|
}
|
|
|
|
config("public_include_path") {
|
|
include_dirs = [ "public" ]
|
|
visibility = [ ":*" ]
|
|
}
|
|
|
|
# GNU build IDs aren't supported by Windows and macOS.
|
|
if (current_os != "mac" && current_os != "win") {
|
|
pw_source_set("build_id") {
|
|
all_dependent_configs = [
|
|
":gnu_build_id",
|
|
":linker_script",
|
|
]
|
|
public_configs = [ ":public_include_path" ]
|
|
cflags = [
|
|
"-Wno-array-bounds",
|
|
"-Wno-stringop-overflow",
|
|
]
|
|
public = [ "public/pw_build_info/build_id.h" ]
|
|
sources = [ "build_id.cc" ]
|
|
deps = [
|
|
dir_pw_preprocessor,
|
|
dir_pw_span,
|
|
]
|
|
}
|
|
}
|
|
|
|
pw_doc_group("docs") {
|
|
sources = [ "docs.rst" ]
|
|
inputs = [ "build_id_linker_snippet.ld" ]
|
|
}
|