2 | | |
3 | | 1. While you still have Xcode 10, and before you upgrade to Xcode 11, create the following directory if needed, to store your SDKs. |
4 | | {{{ |
5 | | /Library/Developer/SDKs |
6 | | }}} |
7 | | 1. check to make sure you have a logical path to the current 10.14 SDK |
8 | | {{{ |
9 | | xcrun --show-sdk-path |
10 | | }}} |
11 | | 1. copy the SDK over, but NOTE!! You are copying MacOSX.sdk to MacOSX10.14.sdk, NOT MacOSX10.14.sdk to MacOSX10.14.sdk. Otherwise you just get a useless symlink. |
12 | | {{{ |
13 | | sudo cp -R /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk /Library/Developer/SDKs/MacOSX10.14.sdk |
14 | | }}} |
15 | | 1. Now upgrade to Xcode 11, and then when you're done with the upgrade, symlink the MacOSX10.14.sdk back: |
| 2 | 1. Find a 10.14 SDK (like in your Xcode 10, for example). |
| 3 | 1. Put it somewhere. |
| 4 | 1. Upgrade to Xcode 11, and symlink the MacOSX10.14.sdk back: |
19 | | 1. and you're good to go with Xcode 11, with everything working in MacPorts until we sort out a more comprehensive plan for SDKROOT handling. |
20 | | 1. You can also symlink it into this directory, which is on the search path for SDKs, but could be volatile if the CommandLineTools are changed or reinstalled. |
21 | | {{{ |
22 | | sudo ln -s /Library/Developer/SDKs/MacOSX10.14.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk |
23 | | }}} |
24 | | |
25 | | using the example in the original post: |
26 | | |
27 | | {{{ |
28 | | macOS 10.14.6 18G103 |
29 | | Xcode 11.0 11A420a |
30 | | }}} |
31 | | |
32 | | {{{ |
33 | | $ cat test.cc |
34 | | #include <iostream> |
35 | | |
36 | | int main(void) |
37 | | { |
38 | | std::cout << "Hello world\n"; |
39 | | |
40 | | return 0; |
41 | | } |
42 | | |
43 | | $ g++-mp-9 test.cc |
44 | | $ ./a.out |
45 | | Hello world |
46 | | }}} |
47 | | |
48 | | What pitfalls may be found on extensive testing are as yet unknown. Rebuilding gcc will fail until the 10.15 headers issue is sorted out, although you can most probably build gcc against the 10.14 headers if you `-isysroot` it to there. |
| 8 | You're done. |