Merge topic 'xcode-5'
a3194ff Xcode: Fix OBJECT library support for Xcode 5 (#14254) dff8d11 Xcode: Drop XCODE_DEPEND_HELPER for Xcode >= 5 1180322 Xcode: Teach Tests/BuildDepends to allow LINK_DEPENDS_NO_SHARED failure 765b46d Xcode: Fix test architecture selection for Xcode >= 5
This commit is contained in:
commit
e27523a834
@ -431,13 +431,16 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||||||
|
|
||||||
// Add XCODE depend helper
|
// Add XCODE depend helper
|
||||||
std::string dir = mf->GetCurrentOutputDirectory();
|
std::string dir = mf->GetCurrentOutputDirectory();
|
||||||
cmCustomCommandLine makecommand;
|
cmCustomCommandLine makeHelper;
|
||||||
makecommand.push_back("make");
|
if(this->XcodeVersion < 50)
|
||||||
makecommand.push_back("-C");
|
{
|
||||||
makecommand.push_back(dir.c_str());
|
makeHelper.push_back("make");
|
||||||
makecommand.push_back("-f");
|
makeHelper.push_back("-C");
|
||||||
makecommand.push_back(this->CurrentXCodeHackMakefile.c_str());
|
makeHelper.push_back(dir.c_str());
|
||||||
makecommand.push_back(""); // placeholder, see below
|
makeHelper.push_back("-f");
|
||||||
|
makeHelper.push_back(this->CurrentXCodeHackMakefile.c_str());
|
||||||
|
makeHelper.push_back(""); // placeholder, see below
|
||||||
|
}
|
||||||
|
|
||||||
// Add ZERO_CHECK
|
// Add ZERO_CHECK
|
||||||
bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION");
|
bool regenerate = !mf->IsOn("CMAKE_SUPPRESS_REGENERATION");
|
||||||
@ -477,17 +480,18 @@ cmGlobalXCodeGenerator::AddExtraTargets(cmLocalGenerator* root,
|
|||||||
// run the depend check makefile as a post build rule
|
// run the depend check makefile as a post build rule
|
||||||
// this will make sure that when the next target is built
|
// this will make sure that when the next target is built
|
||||||
// things are up-to-date
|
// things are up-to-date
|
||||||
if((target.GetType() == cmTarget::EXECUTABLE ||
|
if(!makeHelper.empty() &&
|
||||||
|
(target.GetType() == cmTarget::EXECUTABLE ||
|
||||||
// Nope - no post-build for OBJECT_LIRBRARY
|
// Nope - no post-build for OBJECT_LIRBRARY
|
||||||
// target.GetType() == cmTarget::OBJECT_LIBRARY ||
|
// target.GetType() == cmTarget::OBJECT_LIBRARY ||
|
||||||
target.GetType() == cmTarget::STATIC_LIBRARY ||
|
target.GetType() == cmTarget::STATIC_LIBRARY ||
|
||||||
target.GetType() == cmTarget::SHARED_LIBRARY ||
|
target.GetType() == cmTarget::SHARED_LIBRARY ||
|
||||||
target.GetType() == cmTarget::MODULE_LIBRARY))
|
target.GetType() == cmTarget::MODULE_LIBRARY))
|
||||||
{
|
{
|
||||||
makecommand[makecommand.size()-1] =
|
makeHelper[makeHelper.size()-1] = // fill placeholder
|
||||||
this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
|
this->PostBuildMakeTarget(target.GetName(), "$(CONFIGURATION)");
|
||||||
cmCustomCommandLines commandLines;
|
cmCustomCommandLines commandLines;
|
||||||
commandLines.push_back(makecommand);
|
commandLines.push_back(makeHelper);
|
||||||
lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(),
|
lg->GetMakefile()->AddCustomCommandToTarget(target.GetName(),
|
||||||
no_depends,
|
no_depends,
|
||||||
commandLines,
|
commandLines,
|
||||||
@ -1027,18 +1031,21 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add object library contents as external objects. (Equivalent to
|
if(this->XcodeVersion < 50)
|
||||||
// the externalObjFiles above, except each one is not a cmSourceFile
|
|
||||||
// within the target.)
|
|
||||||
std::vector<std::string> objs;
|
|
||||||
this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
|
|
||||||
for(std::vector<std::string>::const_iterator
|
|
||||||
oi = objs.begin(); oi != objs.end(); ++oi)
|
|
||||||
{
|
{
|
||||||
std::string obj = *oi;
|
// Add object library contents as external objects. (Equivalent to
|
||||||
cmXCodeObject* xsf =
|
// the externalObjFiles above, except each one is not a cmSourceFile
|
||||||
this->CreateXCodeSourceFileFromPath(obj, cmtarget, "");
|
// within the target.)
|
||||||
externalObjFiles.push_back(xsf);
|
std::vector<std::string> objs;
|
||||||
|
this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs);
|
||||||
|
for(std::vector<std::string>::const_iterator
|
||||||
|
oi = objs.begin(); oi != objs.end(); ++oi)
|
||||||
|
{
|
||||||
|
std::string obj = *oi;
|
||||||
|
cmXCodeObject* xsf =
|
||||||
|
this->CreateXCodeSourceFileFromPath(obj, cmtarget, "");
|
||||||
|
externalObjFiles.push_back(xsf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// some build phases only apply to bundles and/or frameworks
|
// some build phases only apply to bundles and/or frameworks
|
||||||
@ -2765,13 +2772,6 @@ void cmGlobalXCodeGenerator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Skip link information for static libraries.
|
|
||||||
if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY ||
|
|
||||||
cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Loop over configuration types and set per-configuration info.
|
// Loop over configuration types and set per-configuration info.
|
||||||
for(std::vector<std::string>::iterator i =
|
for(std::vector<std::string>::iterator i =
|
||||||
this->CurrentConfigurationTypes.begin();
|
this->CurrentConfigurationTypes.begin();
|
||||||
@ -2784,6 +2784,31 @@ void cmGlobalXCodeGenerator
|
|||||||
configName = 0;
|
configName = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this->XcodeVersion >= 50)
|
||||||
|
{
|
||||||
|
// Add object library contents as link flags.
|
||||||
|
std::string linkObjs;
|
||||||
|
const char* sep = "";
|
||||||
|
std::vector<std::string> objs;
|
||||||
|
this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs);
|
||||||
|
for(std::vector<std::string>::const_iterator
|
||||||
|
oi = objs.begin(); oi != objs.end(); ++oi)
|
||||||
|
{
|
||||||
|
linkObjs += sep;
|
||||||
|
sep = " ";
|
||||||
|
linkObjs += this->XCodeEscapePath(oi->c_str());
|
||||||
|
}
|
||||||
|
this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
|
||||||
|
linkObjs.c_str(), configName);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip link information for object libraries.
|
||||||
|
if(cmtarget->GetType() == cmTarget::OBJECT_LIBRARY ||
|
||||||
|
cmtarget->GetType() == cmTarget::STATIC_LIBRARY)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
// Compute the link library and directory information.
|
// Compute the link library and directory information.
|
||||||
cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
|
cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
|
||||||
if(!pcli)
|
if(!pcli)
|
||||||
@ -3338,8 +3363,11 @@ void cmGlobalXCodeGenerator
|
|||||||
cmXCodeObject* t = *i;
|
cmXCodeObject* t = *i;
|
||||||
this->AddDependAndLinkInformation(t);
|
this->AddDependAndLinkInformation(t);
|
||||||
}
|
}
|
||||||
// now create xcode depend hack makefile
|
if(this->XcodeVersion < 50)
|
||||||
this->CreateXCodeDependHackTarget(targets);
|
{
|
||||||
|
// now create xcode depend hack makefile
|
||||||
|
this->CreateXCodeDependHackTarget(targets);
|
||||||
|
}
|
||||||
// now add all targets to the root object
|
// now add all targets to the root object
|
||||||
cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
|
cmXCodeObject* allTargets = this->CreateObject(cmXCodeObject::OBJECT_LIST);
|
||||||
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
|
for(std::vector<cmXCodeObject*>::iterator i = targets.begin();
|
||||||
|
@ -7,8 +7,8 @@ function(test_for_xcode4 result_var)
|
|||||||
execute_process(COMMAND xcodebuild -version
|
execute_process(COMMAND xcodebuild -version
|
||||||
OUTPUT_VARIABLE ov RESULT_VARIABLE rv
|
OUTPUT_VARIABLE ov RESULT_VARIABLE rv
|
||||||
)
|
)
|
||||||
if("${rv}" STREQUAL "0")
|
if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.")
|
||||||
if(ov MATCHES "^Xcode 4.[0-9].*$")
|
if(NOT CMAKE_MATCH_1 VERSION_LESS 4)
|
||||||
set(${result_var} 1 PARENT_SCOPE)
|
set(${result_var} 1 PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
@ -285,6 +285,8 @@ if(EXISTS "${link_depends_no_shared_check_txt}")
|
|||||||
file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
|
file(STRINGS "${link_depends_no_shared_check_txt}" link_depends_no_shared_check LIMIT_COUNT 1)
|
||||||
if("${link_depends_no_shared_check}" STREQUAL "0")
|
if("${link_depends_no_shared_check}" STREQUAL "0")
|
||||||
message(STATUS "link_depends_no_shared_exe is older than link_depends_no_shared_lib as expected.")
|
message(STATUS "link_depends_no_shared_exe is older than link_depends_no_shared_lib as expected.")
|
||||||
|
elseif(XCODE AND NOT XCODE_VERSION VERSION_LESS 5)
|
||||||
|
message(STATUS "Known limitation: link_depends_no_shared_exe is newer than link_depends_no_shared_lib but we cannot stop Xcode ${XCODE_VERSION} from enforcing this dependency.")
|
||||||
else()
|
else()
|
||||||
message(SEND_ERROR "Project did not rebuild properly: link_depends_no_shared_exe is newer than link_depends_no_shared_lib.")
|
message(SEND_ERROR "Project did not rebuild properly: link_depends_no_shared_exe is newer than link_depends_no_shared_lib.")
|
||||||
endif()
|
endif()
|
||||||
|
@ -7,8 +7,8 @@ function(test_for_xcode4 result_var)
|
|||||||
execute_process(COMMAND xcodebuild -version
|
execute_process(COMMAND xcodebuild -version
|
||||||
OUTPUT_VARIABLE ov RESULT_VARIABLE rv
|
OUTPUT_VARIABLE ov RESULT_VARIABLE rv
|
||||||
)
|
)
|
||||||
if("${rv}" STREQUAL "0")
|
if("${rv}" STREQUAL "0" AND ov MATCHES "^Xcode ([0-9]+)\\.")
|
||||||
if(ov MATCHES "^Xcode 4.[0-9].*$")
|
if(NOT CMAKE_MATCH_1 VERSION_LESS 4)
|
||||||
set(${result_var} 1 PARENT_SCOPE)
|
set(${result_var} 1 PARENT_SCOPE)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user