summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmSystemTools.cxx44
-rw-r--r--Source/cmVS10CSharpFlagTable.h4
-rw-r--r--Source/cmVS11CSharpFlagTable.h4
-rw-r--r--Source/cmVS12CSharpFlagTable.h4
-rw-r--r--Source/cmVS140CSharpFlagTable.h4
-rw-r--r--Source/cmVS141CSharpFlagTable.h4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx4
-rw-r--r--Tests/CSharpOnly/CMakeLists.txt3
-rw-r--r--Tests/CSharpOnly/empty.cs0
-rw-r--r--Tests/CSharpOnly/empty.txt0
10 files changed, 48 insertions, 23 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index d05d660..568ee82 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1733,6 +1733,32 @@ void list_item_verbose(FILE* out, struct archive_entry* entry)
fflush(out);
}
+bool la_diagnostic(struct archive* ar, __LA_SSIZE_T r)
+{
+ // See archive.h definition of ARCHIVE_OK for return values.
+
+ if (r >= ARCHIVE_OK) {
+ return true;
+ }
+
+ if (r >= ARCHIVE_WARN) {
+ const char* warn = archive_error_string(ar);
+ if (!warn) {
+ warn = "unknown warning";
+ }
+ std::cerr << "cmake -E tar: warning: " << warn << '\n';
+ return true;
+ }
+
+ // Error.
+ const char* err = archive_error_string(ar);
+ if (!err) {
+ err = "unknown error";
+ }
+ std::cerr << "cmake -E tar: error: " << err << '\n';
+ return false;
+}
+
// Return 'true' on success
bool copy_data(struct archive* ar, struct archive* aw)
{
@@ -1746,24 +1772,17 @@ bool copy_data(struct archive* ar, struct archive* aw)
# endif
for (;;) {
- // Return value:
- // * ARCHIVE_OK - read succeed
- // * ARCHIVE_EOF - no more data to read left
+ // See archive.h definition of ARCHIVE_OK for return values.
r = archive_read_data_block(ar, &buff, &size, &offset);
if (r == ARCHIVE_EOF) {
return true;
}
- if (r != ARCHIVE_OK) {
+ if (!la_diagnostic(ar, r)) {
return false;
}
- // Return value:
- // * >= ARCHIVE_OK - write succeed
- // * < ARCHIVE_OK - write failed
- const __LA_SSIZE_T w_size =
- archive_write_data_block(aw, buff, size, offset);
- if (w_size < ARCHIVE_OK) {
- cmSystemTools::Message("archive_write_data_block()",
- archive_error_string(aw));
+ // See archive.h definition of ARCHIVE_OK for return values.
+ __LA_SSIZE_T const w = archive_write_data_block(aw, buff, size, offset);
+ if (!la_diagnostic(ar, w)) {
return false;
}
}
@@ -1822,7 +1841,6 @@ bool extract_tar(const char* outFileName, bool verbose, bool extract)
r = archive_write_header(ext, entry);
if (r == ARCHIVE_OK) {
if (!copy_data(a, ext)) {
- cmSystemTools::Error("Problem with copy_data");
break;
}
r = archive_write_finish_entry(ext);
diff --git a/Source/cmVS10CSharpFlagTable.h b/Source/cmVS10CSharpFlagTable.h
index 18d587c..6ac7a76 100644
--- a/Source/cmVS10CSharpFlagTable.h
+++ b/Source/cmVS10CSharpFlagTable.h
@@ -21,8 +21,8 @@ static cmVS7FlagTable cmVS10CSharpFlagTable[] = {
{ "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
{ "", "link", "", "", 0 },
- { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon", "", "",
+ { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
+ { "ApplicationIcon", "win32icon:", "", "",
cmIDEFlagTable::UserValueRequired },
{ "ApplicationManifest", "win32manifest:", "", "",
diff --git a/Source/cmVS11CSharpFlagTable.h b/Source/cmVS11CSharpFlagTable.h
index e3ba83c..18b804a 100644
--- a/Source/cmVS11CSharpFlagTable.h
+++ b/Source/cmVS11CSharpFlagTable.h
@@ -21,8 +21,8 @@ static cmVS7FlagTable cmVS11CSharpFlagTable[] = {
{ "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
{ "", "link", "", "", 0 },
- { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon", "", "",
+ { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
+ { "ApplicationIcon", "win32icon:", "", "",
cmIDEFlagTable::UserValueRequired },
{ "ApplicationManifest", "win32manifest:", "", "",
diff --git a/Source/cmVS12CSharpFlagTable.h b/Source/cmVS12CSharpFlagTable.h
index f8db636..0370499 100644
--- a/Source/cmVS12CSharpFlagTable.h
+++ b/Source/cmVS12CSharpFlagTable.h
@@ -21,8 +21,8 @@ static cmVS7FlagTable cmVS12CSharpFlagTable[] = {
{ "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
{ "", "link", "", "", 0 },
- { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon", "", "",
+ { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
+ { "ApplicationIcon", "win32icon:", "", "",
cmIDEFlagTable::UserValueRequired },
{ "ApplicationManifest", "win32manifest:", "", "",
diff --git a/Source/cmVS140CSharpFlagTable.h b/Source/cmVS140CSharpFlagTable.h
index 055d5cb..f695f45 100644
--- a/Source/cmVS140CSharpFlagTable.h
+++ b/Source/cmVS140CSharpFlagTable.h
@@ -21,8 +21,8 @@ static cmVS7FlagTable cmVS140CSharpFlagTable[] = {
{ "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
{ "", "link", "", "", 0 },
- { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon", "", "",
+ { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
+ { "ApplicationIcon", "win32icon:", "", "",
cmIDEFlagTable::UserValueRequired },
{ "ApplicationManifest", "win32manifest:", "", "",
diff --git a/Source/cmVS141CSharpFlagTable.h b/Source/cmVS141CSharpFlagTable.h
index 66c61bd..1f84097 100644
--- a/Source/cmVS141CSharpFlagTable.h
+++ b/Source/cmVS141CSharpFlagTable.h
@@ -21,8 +21,8 @@ static cmVS7FlagTable cmVS141CSharpFlagTable[] = {
{ "AddModules", "addmodule:", "", "", cmIDEFlagTable::SemicolonAppendable },
{ "", "link", "", "", 0 },
- { "Win32Resource", "win32res", "", "", cmIDEFlagTable::UserValueRequired },
- { "ApplicationIcon", "win32icon", "", "",
+ { "Win32Resource", "win32res:", "", "", cmIDEFlagTable::UserValueRequired },
+ { "ApplicationIcon", "win32icon:", "", "",
cmIDEFlagTable::UserValueRequired },
{ "ApplicationManifest", "win32manifest:", "", "",
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 2d39cbb..09c08d3 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1133,6 +1133,10 @@ void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValues(
void cmVisualStudio10TargetGenerator::WriteMSToolConfigurationValuesManaged(
Elem& e1, std::string const& config)
{
+ if (this->GeneratorTarget->GetType() > cmStateEnums::OBJECT_LIBRARY) {
+ return;
+ }
+
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
Options& o = *(this->ClOptions[config]);
diff --git a/Tests/CSharpOnly/CMakeLists.txt b/Tests/CSharpOnly/CMakeLists.txt
index 0e3e39e..84b58ca 100644
--- a/Tests/CSharpOnly/CMakeLists.txt
+++ b/Tests/CSharpOnly/CMakeLists.txt
@@ -8,3 +8,6 @@ add_library(lib2 SHARED lib2.cs)
add_executable(CSharpOnly csharponly.cs)
target_link_libraries(CSharpOnly lib1 lib2)
+
+add_custom_target(CSharpCustom SOURCES empty.cs)
+add_custom_target(custom.cs DEPENDS empty.txt)
diff --git a/Tests/CSharpOnly/empty.cs b/Tests/CSharpOnly/empty.cs
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CSharpOnly/empty.cs
diff --git a/Tests/CSharpOnly/empty.txt b/Tests/CSharpOnly/empty.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/CSharpOnly/empty.txt