openFrameworks lite

I’m trying something different to have a faster compilation and linking here.
Sometimes I’m only working with graphics, without need of sound, video or communication.
so I’ve decided to edit config.osx.default.mk to avoid compiling and linking some parts of OFW.

I’ve added those lines to PLATFORM_CORE_EXCLUSIONS section

PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/fmodex/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/rtAudio/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/video/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/sound/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/communication/%
PLATFORM_CORE_EXCLUSIONS += $(OF_LIBS_PATH)/openFrameworks/3d/%

and commented out some frameworks too

PLATFORM_FRAMEWORKS =
PLATFORM_FRAMEWORKS += Accelerate
# PLATFORM_FRAMEWORKS += QTKit
# PLATFORM_FRAMEWORKS += AGL
# PLATFORM_FRAMEWORKS += ApplicationServices
# PLATFORM_FRAMEWORKS += AudioToolbox
# PLATFORM_FRAMEWORKS += CoreAudio
PLATFORM_FRAMEWORKS += CoreFoundation
# PLATFORM_FRAMEWORKS += CoreServices
PLATFORM_FRAMEWORKS += OpenGL
PLATFORM_FRAMEWORKS += IOKit
PLATFORM_FRAMEWORKS += Cocoa
PLATFORM_FRAMEWORKS += CoreVideo
PLATFORM_FRAMEWORKS += AVFoundation
PLATFORM_FRAMEWORKS += CoreMedia
# PLATFORM_FRAMEWORKS += QuartzCore
PLATFORM_FRAMEWORKS += Security

and everything is a little bit faster here using Make.
It works without changing any source code of OpenFrameworks.
It would be great to be able to build without even more parts like cairo or Freeimage, FreeType

4 Likes

This is a good attempt at arbitrary OF optimization for your specific projects. OF compiles everything by default, therefore inflating the executable file/adding unnecessary dynamic libraries to your project.
Most times your projects won’t ever make use of all the libraries at once, and so I guess it would be even more cool to make some auto-detect script to detect which libraries/portions of OF you actually use and which aren’t ever accessed across your project, and automatically exclude those. But can’t think about any viable solution to achieve that.

2 Likes

That’s great.

Recently I learned Processing and P5.js and I found that their capability to quickly switch from coding to running, is what OF miss. Especially for graphic stuff, it’s important to easily have a look of what you are creating with your code. Less time you spend to compile, more times you’ll try to make it nicer.

1 Like