Skip to content

Commit 07fc45f

Browse files
ddorwinCQ Bot
authored andcommitted
[idk][build] Update variables in sdk_shared_library
This partially reverts commit 31c4757, restoring some of the variable and variable name changes made in https://fxrev.dev/761902. Bug: 326656468 Change-Id: Ia23a7322cac0b684540820c110cc1e042afc98da Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1233770 Fuchsia-Auto-Submit: David Dorwin <[email protected]> Reviewed-by: David Turner <[email protected]> Commit-Queue: Auto-Submit <[email protected]>
1 parent 301e2da commit 07fc45f

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

build/cpp/sdk_shared_library.gni

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ template("sdk_shared_library") {
175175
"Libraries in the IDK must specify a name that is meaningful in that context.")
176176
atom_name = invoker.sdk_name
177177

178-
sdk_id = "sdk://pkg/${atom_name}"
178+
sdk_root_path = "pkg/${atom_name}"
179+
sdk_id = "sdk://${sdk_root_path}"
179180

180181
no_headers = defined(invoker.no_headers) && invoker.no_headers
181182

@@ -253,9 +254,6 @@ template("sdk_shared_library") {
253254
deps += [ "//build/sdk:partner_idk_shared_libraries_allowlist" ]
254255
}
255256

256-
# Base path for source files of this library in SDKs.
257-
file_base = "pkg/${atom_name}"
258-
259257
# Identify dependencies and their metadata files.
260258
sdk_deps = []
261259
sdk_metas = []
@@ -317,13 +315,18 @@ template("sdk_shared_library") {
317315

318316
sdk_metadata_headers = []
319317
sdk_header_files = []
320-
foreach(header, all_headers) {
318+
319+
if (defined(invoker.include_base)) {
320+
include_base = invoker.include_base
321+
} else if (!no_headers) {
321322
include_base = "include"
322-
if (defined(invoker.include_base)) {
323-
include_base = invoker.include_base
324-
}
323+
}
324+
325+
include_dest = "${sdk_root_path}/include"
326+
327+
foreach(header, all_headers) {
325328
destination = rebase_path(header, include_base)
326-
header_dest = "${file_base}/include/${destination}"
329+
header_dest = "${include_dest}/${destination}"
327330
sdk_metadata_headers += [ header_dest ]
328331
sdk_header_files += [
329332
{
@@ -373,7 +376,7 @@ template("sdk_shared_library") {
373376
assert(rebase_path(invoker.symbols_api, "//") ==
374377
rebase_path(ifs_golden_file, "//"))
375378

376-
packaged_ifs_file = "${file_base}/${ifs_file_name}"
379+
packaged_ifs_file = "${sdk_root_path}/${ifs_file_name}"
377380
}
378381

379382
link_lib = "${link_lib_dir}/${lib_name}"
@@ -427,7 +430,7 @@ template("sdk_shared_library") {
427430
"all_deps",
428431
"sdk_headers_for_internal_use",
429432
])
430-
file_base = file_base
433+
file_base = sdk_root_path
431434
}
432435
} else {
433436
not_needed([
@@ -454,9 +457,9 @@ template("sdk_shared_library") {
454457
"--format",
455458
"shared",
456459
"--root",
457-
file_base,
460+
sdk_root_path,
458461
"--include-dir",
459-
"${file_base}/include",
462+
include_dest,
460463
"--dist-path",
461464
"lib/${lib_name}",
462465
"--arch",
@@ -532,7 +535,7 @@ template("sdk_shared_library") {
532535

533536
meta = {
534537
source = metadata_file
535-
dest = "${file_base}/meta.json"
538+
dest = "${sdk_root_path}/meta.json"
536539
schema = "cc_prebuilt_library"
537540
}
538541

0 commit comments

Comments
 (0)