Hi GN folks-
Library file (shared or static) seem to be the domain of the toolchain + tools. But, sometimes I want to copy a built target to package it up inside of another task.
When I have to do that, it's cumbersome to re-express the logic at every site where I assemble the filename:
if (host_os == "mac") {
_dll_extension = "dylib"
} else if (host_os == "linux") {
_dll_extension = "so"
} else if (host_os == "win") {
_dll_extension = "dll"
} else {
assert(0, "Unknown host os")
}
This isn't great to drop in all over the place; the extensions don't really change much but it's duplicating the logic on "both sides" of the target, and it's verbose and distracting to read.
If get_target_outputs() worked across the build for all target types, of course this problem would go away. But, in the absence of that feature, is there any other more convenient way to express this logic?
I guess it could be tucked away in a .gni file, that seems reasonable enough, but I'm wondering if there's just a first-class GN feature that I've missed that helps here.
Best,
Charles