beardsvibe / buildfox

Minimalistic Ninja generator
MIT License
50 stars 8 forks source link

UX: Built-in transformer names #102

Closed den-mentiei closed 8 years ago

den-mentiei commented 8 years ago

We can go with objects, executable, library, shared_library :)

@jimon

jimon commented 8 years ago

Please avoid cmake at all costs :D

jimon commented 8 years ago

Ok, this one is quite complex and it's so easy to reason about one or another solution. I've decided to collect many solutions just for sake of inspiration.

current one

build obj(*): auto *.cpp
build app(test): auto obj(*)

methods that preserve current semantic

just use *nix agreement, and fix windows case somehow

build *.o: auto *.cpp
build test: auto *.o

forbid using transforms inside path

build obj(tmp/*): auto *.cpp # valid
build tmp/obj(*): auto *.cpp # invalid
build app(test): auto obj(tmp/*)

cmake-ish

build object_files(*): auto *.cpp
build application(test): auto object_files(*)

less cmake-ish

build objects(*): auto *.cpp
build application(test): auto objects(*)

add "function call"-ish symbol n1

build @obj(*): auto *.cpp
build @app(test): auto @obj(*)

add "function call"-ish symbol n2 this one in particular looks mk-ish (from plan9)

build $obj(*): auto *.cpp
build $app(test): auto $obj(*)

add "function call"-ish symbol n3

build %obj(*): auto *.cpp
build %app(test): auto %obj(*)

square brackets n1

build obj[*]: auto *.cpp
build app[test]: auto obj[*]

square brackets n2

build *[obj]: auto *.cpp
build test[app]: auto *[obj]

square brackets n3

build *.[obj]: auto *.cpp
build test.[app]: auto *.[obj]

prepend extension

build *.$obj: auto *.cpp
build test.$app: auto *.$obj

methods that change current semantic

extension transformations list

builds_from obj: c cpp
builds_from exe: obj
build *: auto *.cpp
build test.exe: auto *

implicit recursive auto deduction though still doesn't solve how to specify extension less applicaiton name on *nix

build test.exe: auto *.cpp
xpac27 commented 8 years ago

:+1: *nix agreement :+1: forbid using transforms inside path :+1: less cmake-ish

Not sure about "function call"-ish symbol. The fact that objects() has parenthesis is enough to distinguish it (in my opinion).

I also think "auto" is not really clear, not quite sure I understand it actually. Is it necessary? can it be removed or better named?

jimon commented 8 years ago

Well ok, app, obj and lib are easy :

But then shared library strikes :fire: :rage3:

nope nope nope ...

shlibrary & shlibrary_dep maybe ? or shared libraries are overrated and we shouldn't care too much :shipit: