use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasCxxLibraryValueTakenFromAppendConfigIfPresent.
@Test
public void testResultHasCxxLibraryValueTakenFromAppendConfigIfPresent() {
LinkedHashMap<String, String> appendConfig = new LinkedHashMap<String, String>();
appendConfig.put(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LIBRARY, "value");
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setCxxflags(ImmutableList.of("-stdlib=cxxflagsvalue")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, appendConfig);
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LIBRARY), Matchers.equalTo(appendConfig.get(CxxPlatformXcodeConfigGenerator.CLANG_CXX_LIBRARY)));
}
use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasNoArchSetToAllowAutomaticDeviceSwitchInXcode.
@Test
public void testResultHasNoArchSetToAllowAutomaticDeviceSwitchInXcode() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setCxxflags(ImmutableList.of("-arch", "x86-64")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.ARCHS), Matchers.nullValue());
}
use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasOtherCxxFlagsTakenFromPlatformCxxflagsAndMergedWithAppendConfig.
@Test
public void testResultHasOtherCxxFlagsTakenFromPlatformCxxflagsAndMergedWithAppendConfig() {
LinkedHashMap<String, String> appendConfig = new LinkedHashMap<String, String>();
appendConfig.put(CxxPlatformXcodeConfigGenerator.OTHER_CPLUSPLUSFLAGS, "-flag1 -flag2");
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setCxxflags(ImmutableList.of("-Wno-warning", "-someflag", "-g")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, appendConfig);
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.OTHER_CPLUSPLUSFLAGS), Matchers.equalTo("-flag1 -flag2 -Wno-warning -someflag -g"));
}
use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasIphoneOsSdkRootTakenFromIphoneOsFlavor.
@Test
public void testResultHasIphoneOsSdkRootTakenFromIphoneOsFlavor() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setFlavor(InternalFlavor.of("iphoneos-9.1")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get(CxxPlatformXcodeConfigGenerator.SDKROOT), Matchers.equalTo("iphoneos"));
}
use of com.facebook.buck.cxx.CxxPlatform in project buck by facebook.
the class CxxPlatformXcodeConfigGeneratorTest method testResultHasDeploymentTargetValueTakenFromPlatformCxxflags.
@Test
public void testResultHasDeploymentTargetValueTakenFromPlatformCxxflags() {
CxxPlatform platform = CxxPlatform.builder().from(DEFAULT_PLATFORM).setFlavor(InternalFlavor.of("macosx-12.0")).setCxxflags(ImmutableList.of("-mmacosx-version-min=10.8")).build();
ImmutableMap<String, ImmutableMap<String, String>> buildConfigs = CxxPlatformXcodeConfigGenerator.getDefaultXcodeBuildConfigurationsFromCxxPlatform(platform, new LinkedHashMap<String, String>());
ImmutableMap<String, String> config = buildConfigs.get(CxxPlatformXcodeConfigGenerator.DEBUG_BUILD_CONFIGURATION_NAME);
assertThat(config.get("MACOSX_DEPLOYMENT_TARGET"), Matchers.equalTo("10.8"));
}
Aggregations