[Cmake-commits] CMake branch, next, updated. v2.8.4-1328-g08e888d
Bill Hoffman
bill.hoffman at kitware.com
Fri Apr 1 19:54:26 EDT 2011
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".
The branch, next has been updated
via 08e888d6095375d92da36eb6345bd193ee496a58 (commit)
via 9a6ff95072f9e03713e1a5d16338d97f9b371f4b (commit)
from 3805411731094158b436c97cd2b585f076775d3d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=08e888d6095375d92da36eb6345bd193ee496a58
commit 08e888d6095375d92da36eb6345bd193ee496a58
Merge: 3805411 9a6ff95
Author: Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Fri Apr 1 19:54:23 2011 -0400
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Apr 1 19:54:23 2011 -0400
Merge topic 'fix_vs10_object_files' into next
9a6ff95 Fix for bug where VS2010 did not use .obj files as part of the build.
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=9a6ff95072f9e03713e1a5d16338d97f9b371f4b
commit 9a6ff95072f9e03713e1a5d16338d97f9b371f4b
Author: Bill Hoffman <bill.hoffman at kitware.com>
AuthorDate: Fri Apr 1 16:28:41 2011 -0400
Commit: Bill Hoffman <bill.hoffman at kitware.com>
CommitDate: Fri Apr 1 16:28:41 2011 -0400
Fix for bug where VS2010 did not use .obj files as part of the build.
For VS2010 if a precompiled .obj file was the output of a custom commad,
it was used as part of the build. If it was not, then VS did not
use it as part of the build. This commit updates the test to check
for this issue, and fixes the problem. This fixes bugs #0011891 and
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f872838..b8fef25 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -449,6 +449,8 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
bool header = (*s)->GetPropertyAsBool("HEADER_FILE_ONLY")
|| this->GlobalGenerator->IgnoreFile
((*s)->GetExtension().c_str());
+ std::string ext =
+ cmSystemTools::LowerCase((*s)->GetExtension());
if(!lang)
{
lang = "None";
@@ -469,7 +471,7 @@ void cmVisualStudio10TargetGenerator::WriteGroups()
{
headers.push_back(sf);
}
- else if(sf->GetExtension() == "idl")
+ else if(ext == "idl")
{
idls.push_back(sf);
}
@@ -636,14 +638,28 @@ void cmVisualStudio10TargetGenerator::WriteObjSources()
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
- if((*source)->GetExtension() == "obj")
+ std::string ext =
+ cmSystemTools::LowerCase((*source)->GetExtension());
+ if(ext == "obj" || ext == "o")
{
if(first)
{
this->WriteString("<ItemGroup>\n", 1);
first = false;
}
- this->WriteString("<None Include=\"", 2);
+ // If an object file is generated, then vs10
+ // will use it in the build, and we have to list
+ // it as None instead of Object
+ if((*source)->GetPropertyAsBool("GENERATED"))
+ {
+ this->WriteString("<None Include=\"", 2);
+ }
+ // If it is not a generated object then we have
+ // to use the Object type
+ else
+ {
+ this->WriteString("<Object Include=\"", 2);
+ }
(*this->BuildFileStream ) << (*source)->GetFullPath() << "\" />\n";
}
}
@@ -665,8 +681,8 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
for(std::vector<cmSourceFile*>::const_iterator source = sources.begin();
source != sources.end(); ++source)
{
- std::string ext = (*source)->GetExtension();
- if((*source)->GetCustomCommand() || ext == "obj")
+ std::string ext = cmSystemTools::LowerCase((*source)->GetExtension());
+ if((*source)->GetCustomCommand() || ext == "o" || ext == "obj")
{
continue;
}
diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt
index 3fef135..f12de11 100644
--- a/Tests/ExternalOBJ/CMakeLists.txt
+++ b/Tests/ExternalOBJ/CMakeLists.txt
@@ -51,5 +51,11 @@ ADD_CUSTOM_COMMAND(
DEPENDS ${EXTERNAL_OBJECT}
)
+message("${EXTERNAL_OBJECT}")
# Build an executable using the external object file.
ADD_EXECUTABLE(ExternalOBJ executable.cxx ${CUSTOM_OBJECT})
+# A bug showed up in VS2010 where an object file that was
+# part of a custom commad output worked, but ones that were
+# not didn't work. So, repeat the executable using the object
+# directly and not from the output of the copy.
+ADD_EXECUTABLE(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT})
-----------------------------------------------------------------------
Summary of changes:
Source/cmVisualStudio10TargetGenerator.cxx | 26 +++++++++++++++++++++-----
Tests/ExternalOBJ/CMakeLists.txt | 6 ++++++
2 files changed, 27 insertions(+), 5 deletions(-)
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list