C++ Logo

sg15

Advanced search

Re: [isocpp-sg15] Compiler private dir discussion thu morning

From: Jussi Pakkanen <jpakkane_at_[hidden]>
Date: Wed, 27 Nov 2024 22:54:18 +0200
On Mon, 25 Nov 2024 at 15:29, Boris Kolpackov <boris_at_[hidden]> wrote:

> > it is the build system's responsibility to give each top level target
> > its unique dir and pass compiler flags accordingly
>
> Can you define what is a top-level target? For example, is a utility
> library, which is used to build a number of libraries/executables
> a top-level target?

A top level target would be a shared/static library, executable or
module. Exactly as Meson and CMake currently do it. I don't really
know how object libraries work currently, but the build system could
generate a dir for those cases too.

> Also, what happens if the same object file is used as input to build
> multiple, say, executables? Who is its top-level target?

When it is being compiled the private dir is whatever target it is
being built for. When linking the private dir would be the one for the
link target. This is the same directory unless you specifically take
an obj file from one target to another. Which is totally fine.

Received on 2024-11-27 20:54:33