use of com.facebook.buck.cxx.WindowsLinker in project buck by facebook.
the class PythonBinaryDescription method createInPlaceBinaryRule.
private PythonInPlaceBinary createInPlaceBinaryRule(BuildRuleParams params, BuildRuleResolver resolver, SourcePathRuleFinder ruleFinder, PythonPlatform pythonPlatform, CxxPlatform cxxPlatform, String mainModule, Optional<String> extension, PythonPackageComponents components, ImmutableSet<String> preloadLibraries) {
// We don't currently support targeting Windows.
if (cxxPlatform.getLd().resolve(resolver) instanceof WindowsLinker) {
throw new HumanReadableException("%s: cannot build in-place python binaries for Windows (%s)", params.getBuildTarget(), cxxPlatform.getFlavor());
}
// Add in any missing init modules into the python components.
SourcePath emptyInit = createEmptyInitModule(params, resolver);
components = components.withModules(addMissingInitModules(components.getModules(), emptyInit));
BuildTarget linkTreeTarget = params.getBuildTarget().withAppendedFlavors(InternalFlavor.of("link-tree"));
Path linkTreeRoot = BuildTargets.getGenPath(params.getProjectFilesystem(), linkTreeTarget, "%s");
SymlinkTree linkTree = resolver.addToIndex(new SymlinkTree(linkTreeTarget, params.getProjectFilesystem(), linkTreeRoot, ImmutableMap.<Path, SourcePath>builder().putAll(components.getModules()).putAll(components.getResources()).putAll(components.getNativeLibraries()).build(), ruleFinder));
return PythonInPlaceBinary.from(params, resolver, cxxPlatform, pythonPlatform, mainModule, components, extension.orElse(pythonBuckConfig.getPexExtension()), preloadLibraries, pythonBuckConfig.legacyOutputPath(), ruleFinder, linkTree, pythonPlatform.getEnvironment());
}
Aggregations