It's been too long (though after this I'm starting to feel like it probably still hasn't been long enough) since I've regularly used Xcode, so I upgraded to Xcode 8 the other day, forgetting what a bad idea that can be.
When building CEF3, it adds a flag to the command line: -mmacosx-version-min=10.7 (as set by CEF_TARGET_SDK in cef_variables.cmake). This seems to cause problems with C++11 stuff, as you can see with the following test: (intended to be run in /tmp or similar)
- Code: Select all
tmbp /tmp % echo '#include <initializer_list>' | clang -mmacosx-version-min=10.7 -o test.obj -x c++ -c -
<stdin>:1:10: fatal error: 'initializer_list' file not found
#include <initializer_list>
^
1 error generated.
No such problems if you specify version 10.9 or later, or no version at all:
- Code: Select all
tmbp /tmp % echo '#include <initializer_list>' | clang -mmacosx-version-min=10.9 -o test.obj -x c++ -c -
tmbp /tmp % echo '#include <initializer_list>' | clang -o test.obj -x c++ -c -
Another way of showing the error might be to add something like #include <initializer_list> at the top of cefsimple's simple_app.cc.
This is causing me problems because my program is written using C++11... Is there anything official I can do to fix this? Or am I on my own, having strayed past the recommended Xcode 7.3.1? Is this something that will be getting fixed in future?
(For now I've set CEF_TARGET_SDK to 10.11, and that seems to make things build at least, but I'm not sure what problems I'll encounter - since this is me working on getting the OS X build working, so I can't actually run it to check yet - and this doesn't seem like an ideal solution anyway because it requires some manual intervention after DownloadCEF.cmake has done its thing. But building cefsimple and cefclient this way does work, which makes me hopeful. Though you have to remove -Werror from the compile flags in cef_variables.cmake, because Apple have gone and deprecated a bunch of APIs that they use.)
Thanks,
--Tom