Repository: apple/swift
File: utils/build.ps1 (PowerShell)

Code before:
        # this should be enabled when building the dynamic runtime.
        SwiftDifferentiation_ENABLE_LIBRARY_EVOLUTION = "NO";
      }

    Build-CMakeProject `
      -Src $SourceCache\swift\Runtimes\Supplemental\Volatile `
      -Bin $VolatileBinaryCache `
      -InstallTo "${SDKROOT}\usr" `
      -Platform $Platform `
      -UseBuiltCompilers C,Swift `
      -SwiftSDK $null `
      -UseGNUDriver `
      -Defines @{
        BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
        CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
        CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

        SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
        SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";

        # FIXME(compnerd) this currently causes a build failure on Windows, but
        # this should be enabled when building the dynamic runtime.
        SwiftVolatile_ENABLE_LIBRARY_EVOLUTION = "NO";
      }

    if ($Platform.OS -eq [OS]::Windows) {
      Build-CMakeProject `
        -Src $SourceCache\swift\Runtimes\Supplemental\Runtime `
        -Bin $RuntimeModuleBinaryCache `
        -InstallTo "${SDKROOT}\usr" `
        -Platform $Platform `
        -UseBuiltCompilers C,CXX,Swift `
        -SwiftSDK $null `
        -UseGNUDriver `
        -Defines @{
          BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
          CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
          CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

          SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
          SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";
          SwiftCxxOverlay_DIR = "${OverlayBinaryCache}\Cxx\cmake\SwiftCxxOverlay";

          # FIXME(compnerd) this currently causes a build failure on Windows, but
          # this should be enabled when building the dynamic runtime.
          SwiftRuntime_ENABLE_LIBRARY_EVOLUTION = "NO";

          SwiftRuntime_ENABLE_BACKTRACING = "YES";
        }
    }
  }

Review comment (suggestion):
Can you use an early return here instead:

```
if ($Platform.OS -eq [OS]::Android) {
  return;
}
```

Code after:
      -Defines @{
        BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
        CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

        SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
        SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";

        # FIXME(compnerd) this currently causes a build failure on Windows, but
        # this should be enabled when building the dynamic runtime.
        SwiftDifferentiation_ENABLE_LIBRARY_EVOLUTION = "NO";
      }

    Build-CMakeProject `
      -Src $SourceCache\swift\Runtimes\Supplemental\Volatile `
      -Bin $VolatileBinaryCache `
      -InstallTo "${SDKROOT}\usr" `
      -Platform $Platform `
      -UseBuiltCompilers C,Swift `
      -SwiftSDK $null `
      -UseGNUDriver `
      -Defines @{
        BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
        CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
        CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

        SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";
        SwiftOverlay_DIR = "${OverlayBinaryCache}\cmake\SwiftOverlay";

        # FIXME(compnerd) this currently causes a build failure on Windows, but
        # this should be enabled when building the dynamic runtime.
        SwiftVolatile_ENABLE_LIBRARY_EVOLUTION = "NO";
      }

    if ($Platform.OS -ne [OS]::Windows) {
      return
    }

    Build-CMakeProject `
      -Src $SourceCache\swift\Runtimes\Supplemental\Runtime `
      -Bin $RuntimeModuleBinaryCache `
      -InstallTo "${SDKROOT}\usr" `
      -Platform $Platform `
      -UseBuiltCompilers C,CXX,Swift `
      -SwiftSDK $null `
      -UseGNUDriver `
      -Defines @{
        BUILD_SHARED_LIBS = if ($Static) { "NO" } else { "YES" };
        CMAKE_FIND_PACKAGE_PREFER_CONFIG = "YES";
        CMAKE_STATIC_LIBRARY_PREFIX_Swift = "lib";

        SwiftCore_DIR = "${RuntimeBinaryCache}\cmake\SwiftCore";