<div dir="ltr"><div dir="ltr"><div dir="ltr" class="gmail_attr">On Fri, Aug 28, 2020 at 8:41 PM Ryan Schmidt <<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Aug 28, 2020, at 09:55, Jason Liu wrote:<br>
<br>
>>> However, later in the build, it looks like the MacPorts build system sets SDKROOT based off the value MACOSX_DEPLOYMENT_TARGET.<br>
>>  <br>
>> As far as I know, MacPorts does not do that.<br>
> <br>
> Then it's possible that CMake is doing that. Regardless, if you take a look at the build log from either the 10.14 or 10.15 Azure builds, somehow an environment variable with the name SDKROOT is somehow getting set. The interesting thing, and something I haven't yet been able to figure out, is that the build log on my local machine with macOS 10.11 and Xcode 8.2.1 does not show this environment variable at all, even when I am doing a 'port -vst install'.<br>
<br>
MacPorts base sets the SDKROOT environment variable to the value of ${configure.sdkroot} if the value of ${configure.sdkroot} is not empty. By default, it is not empty on macOS 10.14 and later (because in 10.14 Apple removed the headers from /), and it is empty on 10.13 and earlier.<br>
</blockquote></div><div><br></div><div>Actually, this would perfectly explain the behavior that I've been seeing when comparing my 10.11 machine with the 10.14 and 10.15 Azure builds.<br></div><div dir="ltr"><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>-- </div><div>Jason Liu<br></div></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Aug 28, 2020 at 8:41 PM Ryan Schmidt <<a href="mailto:ryandesign@macports.org">ryandesign@macports.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Aug 28, 2020, at 09:55, Jason Liu wrote:<br>
<br>
>>> However, later in the build, it looks like the MacPorts build system sets SDKROOT based off the value MACOSX_DEPLOYMENT_TARGET.<br>
>>  <br>
>> As far as I know, MacPorts does not do that.<br>
> <br>
> Then it's possible that CMake is doing that. Regardless, if you take a look at the build log from either the 10.14 or 10.15 Azure builds, somehow an environment variable with the name SDKROOT is somehow getting set. The interesting thing, and something I haven't yet been able to figure out, is that the build log on my local machine with macOS 10.11 and Xcode 8.2.1 does not show this environment variable at all, even when I am doing a 'port -vst install'.<br>
<br>
MacPorts base sets the SDKROOT environment variable to the value of ${configure.sdkroot} if the value of ${configure.sdkroot} is not empty. By default, it is not empty on macOS 10.14 and later (because in 10.14 Apple removed the headers from /), and it is empty on 10.13 and earlier.<br>
<br>
<br>
> One more observation is that the value of this mysterious SDKROOT variable is getting set to '/Library/Developer/CommandLineTools/...' in the 10.14 Azure build, but is getting set to '/Applications/Xcode_11.6.app/Contents/Developer/...' in the 10.15 Azure build.<br>
<br>
Then I guess the 10.14 Azure build machine has the command line tools installed and the 10.15 Azure build machine does not. MacPorts is designed to use the CLT if available, and to use Xcode if the port says "use_xcode yes" or if the CLT is not available.<br>
<br>
<br>
> Theoretically, I shouldn't need a patch to do that. Blender's CMake script only runs through its SDK detection code using the xcodebuild command if the OSX_SYSTEM variable doesn't exist. I should be able to circumvent that code by simply setting a value for OSX_SYSTEM as one of the configure.args in the portfile.<br>
<br>
Ok great, if the build system supports setting a variable for that, then do that.<br>
<br>
</blockquote></div></div>