Open bwrsandman opened 1 week ago
@bkaradzic There are many compile-time dependencies for visionOS right now, so I believe there is no point in trying to determine wether or not to enable visionOS in that macro expansion based on the XCode version. Bgfx doesn't support having a single binary for macOS, iOS, and visionOS at this point either way. All of those preprocessor macros checking for BX_PLATFORM_VISION_OS
would need to become runtime checks if we want a single cross-Apple-ecosystem binary. As long as we don't have that, replacing the check on BX_XCODE_15
with BX_PLATFORM_VISION_OS
should do the trick.
@okwasniewski Thoughts on the single-cross-platform bgfx library binary? You worked on the visionOS support. Is it feasible and/or potentially desirable to have one bgfx library?
@bwrsandman You can meanwhile try this:
#if BX_PLATFORM_VISION_OS
# define VISION_OS_MINIMUM visionOS 1.0,
#else
# define VISION_OS_MINIMUM
# warning "XCode 15 is required for visionOS"
#endif
@mcourteaux Yeah, you are right it's not possible to have a single cross-platform binary with bgfx currently.
Probably we could also check using this macros:
#ifndef __VISION_OS_VERSION_MAX_ALLOWED
#define __VISION_OS_VERSION_MAX_ALLOWED 0
#endif
#if __VISION_OS_VERSION_MAX_ALLOWED >= 10000
# define VISION_OS_MINIMUM visionOS 1.0,
#else
# define VISION_OS_MINIMUM
# warning "XCode 15 is required for visionOS"
#endif
Describe the bug The
VISION_OS_MINIMUM
define in renderer_mtl.mm causes a compilation error if you use XCode 15 before 15.2. This is particularly a problem because, at the time of this writing, the github action runnermacos-13
has XCode 15.0.1 installed.The issue stems from the
BX_XCODE_15
define not being granular enough and that the visionOS SDK being released in XCode 15.2. https://github.com/bkaradzic/bgfx/blob/00fa5ad179f5aa13c1e44d0bcbccdc535aba2d00/src/renderer_mtl.mm#L456-L461https://en.wikipedia.org/wiki/VisionOS#Developer_tools
To Reproduce Steps to reproduce the behavior:
Expected behavior
VISION_OS_MINIMUM
is an empty define and there are no compilation errors.Screenshots https://github.com/openblack/openblack/actions/runs/9531646671/job/26272798609?pr=759
Additional context bgfx.cmake: https://github.com/bkaradzic/bgfx.cmake/commit/c0ce1388cc8750894127c56daaa22063aa88bd70 bx: https://github.com/bkaradzic/bx/commit/24527eabfd135dca569904baff1bdfd004ef8b41 bimg: https://github.com/bkaradzic/bimg/commit/59f188a6add2c9ac4b986ccf9724575d3c41da9b bgfx: d1feabe3194b4b41ffd9c5747536acfadeae919b Xcode: 15.0.1