beardsvibe / buildfox

Minimalistic Ninja generator
MIT License
50 stars 8 forks source link

Support for frameworks #74

Closed jimon closed 9 years ago

jimon commented 9 years ago

@xpac27 tested frameworks in his app, it worked just fine, let's wait until he will push his manifest and see if we can simplify it.

jimon commented 9 years ago

So it looked like this :

build obj(*): auto app/src/*.cpp lib/src/ecs/*.cpp lib/src/graphic/*.cpp lib/src/utils/*.cpp lib/src/systems/*.cpp
includedirs = lib/inc lib/src app/src
build app(helloworld): auto obj(*)

filter system: Darwin
    cxxflags = -std=c++11
    ldflags = -fobjc-arc -framework Foundation -framework CoreVideo -framework Cocoa -framework IOKit -framework OpenGL
    libs = objc png GLEW glfw3

Not sure if we need transformer for -framework part, maybe it's just enough to document it.

Though we do need to add -std=c++11 as standard flag :)

jimon commented 9 years ago

C++11 flag is added in #77

xpac27 commented 9 years ago

I vote for frw transformer :) so I could list libs, frameworks and flags separately. Maybe the transformer could then pick the right framework flag depending on the compiler?

Vincent Cogne

On 14 Oct 2015, at 22:12, Dmytro Ivanov notifications@github.com wrote:

So it looked like this :

build obj(): auto app/src/.cpp lib/src/ecs/.cpp lib/src/graphic/.cpp lib/src/utils/.cpp lib/src/systems/.cpp includedirs = lib/inc lib/src app/src build app(helloworld): auto obj(*)

filter system: Darwin cxxflags = -std=c++11 ldflags = -fobjc-arc -framework Foundation -framework CoreVideo -framework Cocoa -framework IOKit -framework OpenGL libs = objc png GLEW glfw3 Not sure if we need transformer for -framework part, maybe it's just enough to document it.

Though we do need to add -std=c++11 as standard flag :)

— Reply to this email directly or view it on GitHub.

den-mentiei commented 9 years ago

Let's just add it to the core as it's tedious to define it every time I want to build something for OSX.

xpac27 commented 9 years ago

Maybe target specific flags would speedup the link and compile time, because then I could link CoreVideo framework on targets that need it only.

xpac27 commented 9 years ago

Actually target specific flags are necessary when it comes to generate code coverage reports and static analysis because they usually require that you add one or two compile flags to the compiler (-fprofile-arcs -ftest-coverage for clang) and the linker (--coverage for clang).

jimon commented 9 years ago

@xpac27 For this one you can use filters :

filter coverage: true toolset: clang
    cxxflags += --fprofile-arcs -ftest-coverage
    ldflags += --coverage
build *.obj: auto *.cpp
jimon commented 9 years ago

Frameworks were added in #80