Skip to content

Compiling MulleObjC or a Foundation with different flags

mulle-kybernetik-tv edited this page Oct 2, 2018 · 1 revision

If you want a Foundation based on a compileflag such as -fobjc-tlu for thread local universes, it is important that all files are compiled with this options.

A complication may arise with cmake, since it does not understand Objective-C as its own language. Therefore there a no separate compile flags besides CMAKE_C_FLAGS. Now when crafting, the system compiler is often used to compile the C libraries and not mulle-clang. Globally overriding CFLAGS with -fobjc-tlu will not work, because the system compiler doesn't know about it.

Solution

Compile everything with mulle-clang Specify your flag for mulle-make to use.

E.g.

mulle-sde clean all
mulle-sde craft -- -DCMAKE_C_COMPILER="mulle-clang" -DOTHER_CFLAGS="-fobjc-tlu"