[build2] Building objective C code

Boris Kolpackov boris at codesynthesis.com
Thu May 5 08:23:24 UTC 2022


Fabian Meyer via users <users at build2.org> writes:

> I am currently trying to compile some objective-C source files using build2
> for MacOS builds of SFML (see https://github.com/build2-packaging/sfml/blob/master/sfml-window/src/buildfile#L72).
> I basically copied the adhoc-recipe from the GLFW package (see
> https://github.com/build2-packaging/glfw/blob/master/glfw/src/buildfile#L24)
> 
> It seems to work or at least do something meaningful. However, during the
> build the compilation of some objective-c files fails, because the compiler
> cannot find certain header files ([...]). The missing header files lie in
> the sfml-system package, which is imported at the top of the buildfile [...].
> Building C++ sources, which also need these headers, works.
> It seems like the exported include paths of the sfml-system dependency are
> not propagated to the adhoc recipe. I tried adding the intf_libs explicitly
> to the adhoc recipe but that did not help.

The current state of the art in Objective-C/C++ compilation is libQt6Core
(warning: it's quite a complex buildfile, and it requires not-yet-released
build2 0.15.0):

https://github.com/build2-packaging/Qt6/blob/master/libQt6Core/QtCore/buildfile

In particular, it solves the problem of obtaining header search paths
from imported libraries (via libul{Qt6CoreMeta}). The buildfile is
quite well commented (IMO), so I think you should be able to figure
out what's going on. But let me know if you have any questions about
any of this.



More information about the users mailing list