         // MARK: Ingested LLVM code.
         .target(
           name: "llvmDemangle",
-          path: "lib/llvm/Demangle"
+          path: "lib/llvm/Demangle",
+          cxxSettings: [
+            .define("LLVM_ON_WIN32", .when(platforms: [.windows])),
+          ]
         ),
 
         .target(
             name: "llvmSupport",
             dependencies: ["llvmDemangle"],
             path: "lib/llvm/Support",
+            cxxSettings: [
+              .define("LLVM_ON_WIN32", .when(platforms: [.windows])),
+            ],
             linkerSettings: [
                 .linkedLibrary("m", .when(platforms: [.linux])),
                 .linkedLibrary("ncurses", .when(platforms: [.linux, .macOS]))]

        .target(
            name: "libllbuild",
            dependencies: ["llbuildCore", "llbuildBuildSystem"],
            path: "products/libllbuild"
        ),

        /// The public llbuild Swift API.

        .target(
            name: "llbuildBasic",
            dependencies: ["llvmSupport"],
            path: "lib/Basic",
            cxxSettings: [
              .define("LLVM_ON_WIN32", .when(platforms: [.windows])),
            ]
        ),
        .target(
            name: "llbuildCore",
