summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx2
-rw-r--r--Tests/Complex/Executable/CMakeLists.txt9
-rw-r--r--Tests/Complex/Executable/complex_nobuild.c1
3 files changed, 10 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f78aeec..8d3416a 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -700,7 +700,7 @@ void cmVisualStudio10TargetGenerator::WriteCLSources()
}
(*this->BuildFileStream ) << sourceFile << "\"";
// ouput any flags specific to this source file
- if(cl && this->OutputSourceSpecificFlags(*source))
+ if(!header && cl && this->OutputSourceSpecificFlags(*source))
{
// if the source file has specific flags the tag
// is ended on a new line
diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt
index 98b29bb..08cc7d4 100644
--- a/Tests/Complex/Executable/CMakeLists.txt
+++ b/Tests/Complex/Executable/CMakeLists.txt
@@ -49,10 +49,17 @@ LINK_LIBRARIES(${COMPLEX_LIBS})
SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES
HEADER_FILE_ONLY 1)
+# Test forcing a .c file to not build.
+# This makes sure a mixed language library is created
+# with header file only sources
+SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES
+ HEADER_FILE_ONLY 1)
+
ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt)
ADD_EXECUTABLE(complex complex testcflags.c )
# Sub1/NameConflictTest.c Sub2/NameConflictTest.c)
-ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx)
+ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx
+ complex_nobuild.c)
IF(COMPLEX_TEST_CMAKELIB)
TARGET_LINK_LIBRARIES(complex CMakeLib cmsys cmexpat cmzlib cmlibarchive cmbzip2 cmcurl)
ENDIF(COMPLEX_TEST_CMAKELIB)
diff --git a/Tests/Complex/Executable/complex_nobuild.c b/Tests/Complex/Executable/complex_nobuild.c
new file mode 100644
index 0000000..6b3c2c1
--- /dev/null
+++ b/Tests/Complex/Executable/complex_nobuild.c
@@ -0,0 +1 @@
+#error "This file should not be compiled."