widberg / bgfx.cmake

https://github.com/bkaradzic/bgfx.cmake. Independently maintained CMake build scripts for bgfx. Released under public domain.
https://github.com/bkaradzic/bgfx.cmake
Creative Commons Zero v1.0 Universal
286 stars 252 forks source link

Fix compiler flags for mixing objective/c++ in xcode #68

Closed JonnyPtn closed 4 years ago

JonnyPtn commented 4 years ago

With the new vulkan stuff in BGFX there are build issues when using the Xcode generator because renderer_vk.cpp is not recognised as mixed objective/c++ file (It needs the .mm extension for that to work).

e.g:

/Applications/Xcode-11.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:504:61: error: unknown type name 'NSString'
FOUNDATION_EXPORT Protocol * _Nullable NSProtocolFromString(NSString *namestr) API_AVAILABLE(macos(10.5), ios(2.0), watchos(2.0), tvos(9.0));

This fixes that by explicitly marking that file as a mixed source file. I also added travis jobs to build OSX with xcode (current jobs only build with makefiles, which don't have this issue for some reason I can't explain...)