         args += buildParameters.toolchain.extraCCFlags
         args += optimizationArguments
 
-        // Add extra C++ flags if this target contains C++ files.
-        if clangTarget.isCXX {
-            args += self.buildParameters.flags.cxxCompilerFlags
-        }
-
         // Only enable ARC on macOS.
       #if os(macOS)
         args += ["-fobjc-arc"]

        args += ["-j\(SwiftCompilerTool.numThreads)", "-DSWIFT_PACKAGE"]
        args += additionalFlags
        args += moduleCacheArgs
        args += buildParameters.swiftCompilerFlags
        return args
    }

        args += ["-I", clangTarget.includeDir.asString]
        args += additionalFlags
        args += moduleCacheArgs

        // User arguments (from -Xcc and -Xcxx below) should follow generated arguments to allow user overrides
        args += buildParameters.flags.cCompilerFlags

        // Add extra C++ flags if this target contains C++ files.
        if clangTarget.isCXX {
            args += self.buildParameters.flags.cxxCompilerFlags
        }
        return args
    }

