Driver/Darwin: Don't error/warn on conflicting deployment targets. Apparently

this is still a popular thing to do.

llvm-svn: 95093
This commit is contained in:
Daniel Dunbar 2010-02-02 17:31:12 +00:00
parent fa5f5965de
commit ffa70e8b27
2 changed files with 16 additions and 7 deletions

View File

@ -62,8 +62,6 @@ def err_drv_invalid_value : Error<"invalid value '%1' in '%0'">;
def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">;
def err_drv_invalid_remap_file : Error<
"invalid option '%0' not of the form <from-file>;<to-file>">;
def err_drv_conflicting_deployment_targets : Error<
"conflicting deployment targets, both MACOSX_DEPLOYMENT_TARGET '%0' and IPHONEOS_DEPLOYMENT_TARGET '%1' are present in environment">;
def warn_drv_input_file_unused : Warning<
"%0: '%1' input unused when '%2' is present">;
@ -87,5 +85,7 @@ def warn_ignoring_ftabstop_value : Warning<
"ignoring invalid -ftabstop value '%0', using default value %1">;
def warn_drv_missing_resource_library : Warning<
"missing resource library '%0', link may fail">;
def warn_drv_conflicting_deployment_targets : Warning<
"conflicting deployment targets, both MACOSX_DEPLOYMENT_TARGET '%0' and IPHONEOS_DEPLOYMENT_TARGET '%1' are present in environment">;
}

View File

@ -385,12 +385,21 @@ DerivedArgList *Darwin::TranslateArgs(InputArgList &Args,
if (iPhoneOSTarget && iPhoneOSTarget[0] == '\0')
iPhoneOSTarget = 0;
if (OSXTarget) {
// Diagnose conflicting deployment targets.
if (iPhoneOSTarget)
getDriver().Diag(clang::diag::err_drv_conflicting_deployment_targets)
<< OSXTarget << iPhoneOSTarget;
// Diagnose conflicting deployment targets, and choose default platform
// based on the tool chain.
//
// FIXME: Don't hardcode default here.
if (OSXTarget && iPhoneOSTarget) {
// FIXME: We should see if we can get away with warning or erroring on
// this. Perhaps put under -pedantic?
if (getTriple().getArch() == llvm::Triple::arm ||
getTriple().getArch() == llvm::Triple::thumb)
OSXVersion = 0;
else
iPhoneVersion = 0;
}
if (OSXTarget) {
const Option *O = Opts.getOption(options::OPT_mmacosx_version_min_EQ);
OSXVersion = DAL->MakeJoinedArg(0, O, OSXTarget);
DAL->append(OSXVersion);