diff options
author | Stephen Kelly <steveire@gmail.com> | 2014-02-13 16:25:00 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2014-04-02 21:14:02 (GMT) |
commit | e6971df6ab647031ba9689c9afbbde78cc62e35f (patch) | |
tree | c9c67c6e3a1627d65cda8ee93373b97403c92106 /Source/cmGlobalXCodeGenerator.cxx | |
parent | df753df94bb1e995372baabb0240585560c72ded (diff) | |
download | CMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.zip CMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.tar.gz CMake-e6971df6ab647031ba9689c9afbbde78cc62e35f.tar.bz2 |
cmTarget: Make the source files depend on the config.
Disallow the use of config-specific source files with
the Visual Studio and Xcode generators. They don't have
any way to represent the condition currently.
Use the same common-config API in cmQtAutoGenerators. While
it accepts config-specific files, it doesn't have to support
multiple configurations yet.
Loop over the configs in cmTargetTraceDependencies
and cmGlobalGenerator::WriteSummary and consume all source
files.
Loop over the configs in cmComputeTargetDepends and compute the
object library dependencies for each config.
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index d9d4927..b3975b4 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -984,7 +984,10 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // organize the sources std::vector<cmSourceFile*> classes; - cmtarget.GetSourceFiles(classes); + if (!cmtarget.GetConfigCommonSourceFiles(classes)) + { + return; + } std::sort(classes.begin(), classes.end(), cmSourceFilePathCompare()); gtgt->ComputeObjectMapping(); @@ -1043,7 +1046,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen, // the externalObjFiles above, except each one is not a cmSourceFile // within the target.) std::vector<std::string> objs; - gtgt->UseObjectLibraries(objs); + gtgt->UseObjectLibraries(objs, ""); for(std::vector<std::string>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { @@ -1359,7 +1362,10 @@ void cmGlobalXCodeGenerator::CreateCustomCommands(cmXCodeObject* buildPhases, } std::vector<cmSourceFile*> classes; - cmtarget.GetSourceFiles(classes); + if (!cmtarget.GetConfigCommonSourceFiles(classes)) + { + return; + } // add all the sources std::vector<cmCustomCommand> commands; for(std::vector<cmSourceFile*>::const_iterator i = classes.begin(); @@ -2439,7 +2445,11 @@ cmGlobalXCodeGenerator::CreateUtilityTarget(cmTarget& cmtarget) if(cmtarget.GetType() == cmTarget::UTILITY) { std::vector<cmSourceFile*> sources; - cmtarget.GetSourceFiles(sources); + if (!cmtarget.GetConfigCommonSourceFiles(sources)) + { + return 0; + } + for(std::vector<cmSourceFile*>::const_iterator i = sources.begin(); i != sources.end(); ++i) { @@ -2808,7 +2818,7 @@ void cmGlobalXCodeGenerator std::string linkObjs; const char* sep = ""; std::vector<std::string> objs; - this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs); + this->GetGeneratorTarget(cmtarget)->UseObjectLibraries(objs, ""); for(std::vector<std::string>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { @@ -2943,8 +2953,10 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, } std::vector<cmSourceFile*> classes; - cmtarget.GetSourceFiles(classes); - + if (!cmtarget.GetConfigCommonSourceFiles(classes)) + { + return; + } // Put cmSourceFile instances in proper groups: for(std::vector<cmSourceFile*>::const_iterator s = classes.begin(); s != classes.end(); s++) @@ -2962,7 +2974,7 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root, // Put OBJECT_LIBRARY objects in proper groups: std::vector<std::string> objs; - this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs); + this->GetGeneratorTarget(&cmtarget)->UseObjectLibraries(objs, ""); for(std::vector<std::string>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { |