jimporter / bfg9000

bfg9000 - build file generator
https://jimporter.github.io/bfg9000
BSD 3-Clause "New" or "Revised" License
76 stars 21 forks source link

intermediate outputs should be stashed in a subdirectory of the build directory #94

Closed jmgao closed 4 years ago

jmgao commented 7 years ago

Collisions can occur between intermediate outputs and final outputs right now, since they're dumped in the same folder.

The build file:

executable("foo", "foo/foo.cpp")

will create a ninja file with these conflicting targets:

build foo/foo.o: cxx $srcdir/foo/foo.cpp
build foo: cxx_link foo/foo.o
jimporter commented 7 years ago

This is intentional, but it's arguably the wrong move. I'm not sure though whether intermediate files should be considered intermediate by their type (e.g. .o files) or by whether they're implicitly generated, as in this case.

jimporter commented 6 years ago

I'm going to try to make sure I have an answer for this (even if it's WONTFIX; I haven't decided) by 0.5.

jimporter commented 4 years ago

Currently, I have a patch for this to put implicitly-defined object files (i.e. object files generated by passing source files to executable and friends) into an intermediate dir based on the name of the resulting executable/library. I'm debating whether this should be enabled by default or not though. Personally, I prefer not having intermediate dirs since it matches the structure of the srcdir better (and since I always put source files in src/, I don't run into conflicts). However, defaulting to intermediate dirs ensures that more stuff Just Works, like the case in the initial comment.

Decisions, decisions...

jimporter commented 4 years ago

Resolved, with an opt-out: project(intermediate_dirs=False)