diff options
author | Brad King <brad.king@kitware.com> | 2010-09-30 12:48:38 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-09-30 12:48:38 (GMT) |
commit | 448661fbe5c93fb1f59ea45847b3eef75e7b4a8a (patch) | |
tree | e498a99a4557aaba60a83f7205328fd296b39808 /Source/cmVisualStudio10TargetGenerator.cxx | |
parent | 4e137de7b1e49db168228607864e80a6960ec52f (diff) | |
download | CMake-448661fbe5c93fb1f59ea45847b3eef75e7b4a8a.zip CMake-448661fbe5c93fb1f59ea45847b3eef75e7b4a8a.tar.gz CMake-448661fbe5c93fb1f59ea45847b3eef75e7b4a8a.tar.bz2 |
VS10: Skip targets with no linker language (#11230)
In targets with no non-header files the linker language cannot be
determined. Since the target project file cannot be generated at all in
this case, give up as soon as it is detected. Otherwise the generation
code may try to run with uninitialized information.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 8dfafff..a92e56f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -125,7 +125,10 @@ void cmVisualStudio10TargetGenerator::Generate() ".vcxproj"); if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY) { - this->ComputeClOptions(); + if(!this->ComputeClOptions()) + { + return; + } } cmMakefile* mf = this->Target->GetMakefile(); std::string path = mf->GetStartOutputDirectory(); @@ -949,19 +952,23 @@ OutputLinkIncremental(std::string const& configName) } //---------------------------------------------------------------------------- -void cmVisualStudio10TargetGenerator::ComputeClOptions() +bool cmVisualStudio10TargetGenerator::ComputeClOptions() { std::vector<std::string> const* configs = this->GlobalGenerator->GetConfigurations(); for(std::vector<std::string>::const_iterator i = configs->begin(); i != configs->end(); ++i) { - this->ComputeClOptions(*i); + if(!this->ComputeClOptions(*i)) + { + return false; + } } + return true; } //---------------------------------------------------------------------------- -void cmVisualStudio10TargetGenerator::ComputeClOptions( +bool cmVisualStudio10TargetGenerator::ComputeClOptions( std::string const& configName) { // much of this was copied from here: @@ -984,7 +991,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions( cmSystemTools::Error ("CMake can not determine linker language for target:", this->Name.c_str()); - return; + return false; } if(strcmp(linkLanguage, "C") == 0 || strcmp(linkLanguage, "CXX") == 0 || strcmp(linkLanguage, "Fortran") == 0) @@ -1044,6 +1051,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions( } this->ClOptions[configName] = pOptions.release(); + return true; } //---------------------------------------------------------------------------- |