mirror of
https://github.com/Relintai/osxcross.git
synced 2025-02-08 02:55:56 +01:00
Improve '-stdlib=libc++' error message when a too old SDK is used (closes #52)
This just required to move some code around. The appropriate error message was already there. Before: osxcross: error: targeted OS X version must be <= 10.6.0 (SDK) After: osxcross: error: libc++ requires Mac OS X SDK 10.7 (or later)
This commit is contained in:
parent
68cca0de16
commit
989c7f3b5f
@ -516,15 +516,6 @@ bool Target::setup() {
|
||||
}
|
||||
}
|
||||
|
||||
if (OSNum > SDKOSNum) {
|
||||
err << "targeted OS X version must be <= " << SDKOSNum.Str() << " (SDK)"
|
||||
<< err.endl();
|
||||
return false;
|
||||
} else if (OSNum < OSVersion(10, 4)) {
|
||||
err << "targeted OS X version must be >= 10.4" << err.endl();
|
||||
return false;
|
||||
}
|
||||
|
||||
if (haveArch(Arch::x86_64h) && OSNum < OSVersion(10, 8)) {
|
||||
// -mmacosx-version-min= < 10.8 in combination with '-arch x86_64h'
|
||||
// may cause linker errors.
|
||||
@ -556,6 +547,15 @@ bool Target::setup() {
|
||||
}
|
||||
}
|
||||
|
||||
if (OSNum > SDKOSNum) {
|
||||
err << "targeted OS X version must be <= " << SDKOSNum.Str() << " (SDK)"
|
||||
<< err.endl();
|
||||
return false;
|
||||
} else if (OSNum < OSVersion(10, 4)) {
|
||||
err << "targeted OS X version must be >= 10.4" << err.endl();
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string CXXHeaderPath = SDKPath;
|
||||
string_vector AdditionalCXXHeaderPaths;
|
||||
|
||||
|
@ -339,6 +339,12 @@ eval $(osxcross-conf)
|
||||
run o64-clang++ -stdlib=foo
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "${lines[0]}" == *error:\ value\ of\ \'-stdlib=\'\ must\ be\ \'default\',\ \'libc++\'\ or\ \'libstdc++\' ]]
|
||||
|
||||
if [ $(osxcross-cmp $OSXCROSS_SDK_VERSION "<" 10.7) -eq 1 ]; then
|
||||
run o64-clang++ -stdlib=libc++
|
||||
[ "$status" -ne 0 ]
|
||||
[[ "${lines[0]}" == *error:\ libc++\ requires\ Mac\ OS\ X\ SDK\ 10.7\ \(or\ later\) ]]
|
||||
fi
|
||||
}
|
||||
|
||||
@test "precompiled headers" {
|
||||
@ -411,10 +417,12 @@ eval $(osxcross-conf)
|
||||
[[ "${lines[0]}" != *\ -m64\ * ]]
|
||||
[[ "${lines[0]}" != *\ -arch\ * ]]
|
||||
|
||||
if [ $(osxcross-cmp $OSXCROSS_SDK_VERSION ">=" 10.8) -eq 1 ]; then
|
||||
run o64-g++ -arch x86_64h
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "${lines[0]}" == *error:\ gcc\ does\ not\ support\ architecture\ \'x86_64h\' ]]
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@test "bad include path warning" {
|
||||
|
Loading…
Reference in New Issue
Block a user