Meta: Update the build rules for AK

The `gn` build did not generate the CMake configuration file for the
backtrace module. Update the rules to configure the generated macros
mirroring the CMake build.
This commit is contained in:
Saleem Abdulrasool 2024-09-24 20:05:35 -07:00 committed by Andrew Kaster
parent 96fbb33b13
commit 050ffddff3
Notes: github-actions[bot] 2024-09-25 18:42:03 +00:00
2 changed files with 21 additions and 2 deletions

View file

@ -84,7 +84,7 @@ def main():
try:
var, val = var.split(None, 1)
in_line = '#define %s %s' % (var, val) # val ends in \n.
except _:
except ValueError:
var = var.rstrip()
in_line = '#define %s\n' % var
if not values[var]:

View file

@ -11,7 +11,10 @@ shared_library("AK") {
output_name = "ak"
public_configs = [ ":ak_headers" ]
public_deps = [ ":ak_debug_gen" ]
public_deps = [
":ak_backtrace_gen",
":ak_debug_gen",
]
# FIXME: Split out non-kernel sources to their own set
sources = [
@ -287,3 +290,19 @@ write_cmake_config("ak_debug_gen") {
"XML_PARSER_DEBUG=",
]
}
write_cmake_config("ak_backtrace_gen") {
input = "Backtrace.h.in"
output = "$root_gen_dir/AK/Backtrace.h"
if (current_os == "win") {
values = [
"Backtrace_FOUND=",
"Backtrace_HEADER=",
]
} else {
values = [
"Backtrace_FOUND=1",
"Backtrace_HEADER=execinfo.h",
]
}
}