use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class AppleCxxPlatformsTest method appleTVOSSimulatorPlatformSetsLinkerFlags.
@Test
public void appleTVOSSimulatorPlatformSetsLinkerFlags() throws Exception {
AppleSdkPaths appleSdkPaths = AppleSdkPaths.builder().setDeveloperPath(Paths.get(".")).addToolchainPaths(Paths.get("Toolchains/XcodeDefault.xctoolchain")).setPlatformPath(Paths.get("Platforms/AppleTVSimulator.platform")).setSdkPath(Paths.get("Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator9.1.sdk")).build();
ImmutableSet<Path> paths = ImmutableSet.<Path>builder().addAll(COMMON_KNOWN_PATHS).add(Paths.get("Platforms/AppleTVSimulator.platform/Developer/usr/bin/libtool")).add(Paths.get("Platforms/AppleTVSimulator.platform/Developer/usr/bin/ar")).build();
AppleToolchain toolchain = AppleToolchain.builder().setIdentifier("com.apple.dt.XcodeDefault").setPath(Paths.get("Toolchains/XcodeDefault.xctoolchain")).setVersion("1").build();
AppleSdk targetSdk = AppleSdk.builder().setApplePlatform(ApplePlatform.APPLETVSIMULATOR).setName("appletvsimulator9.1").setVersion("9.1").setToolchains(ImmutableList.of(toolchain)).build();
AppleCxxPlatform appleCxxPlatform = AppleCxxPlatforms.buildWithExecutableChecker(projectFilesystem, targetSdk, "9.1", "arm64", appleSdkPaths, FakeBuckConfig.builder().build(), new FakeAppleConfig(), new FakeExecutableFinder(paths), Optional.empty(), Optional.empty());
CxxPlatform cxxPlatform = appleCxxPlatform.getCxxPlatform();
assertThat(cxxPlatform.getCflags(), hasItem("-mtvos-simulator-version-min=9.1"));
assertThat(cxxPlatform.getLdflags(), hasItem("-mtvos-simulator-version-min=9.1"));
}
use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class HalideLibraryBuilder method createDefaultPlatforms.
// The #halide-compiler version of the HalideLibrary rule expects to be able
// to find a CxxFlavor to use when building for the host architecture.
// AbstractCxxBuilder doesn't create the default host flavor, so we "override"
// the createDefaultPlatforms() method here.
public static FlavorDomain<CxxPlatform> createDefaultPlatforms() {
Flavor hostFlavor = CxxPlatforms.getHostFlavor();
CxxPlatform hostCxxPlatform = CxxPlatform.builder().from(CxxPlatformUtils.DEFAULT_PLATFORM).setFlavor(hostFlavor).build();
CxxPlatform defaultCxxPlatform = createDefaultPlatform();
return new FlavorDomain<>("C/C++ Platform", ImmutableMap.<Flavor, CxxPlatform>builder().put(defaultCxxPlatform.getFlavor(), defaultCxxPlatform).put(hostCxxPlatform.getFlavor(), hostCxxPlatform).build());
}
Aggregations