mirror of
https://github.com/reactos/CMake.git
synced 2025-02-08 21:09:48 +00:00
BUG: Make sure sources with unknown extensions are not compiled by VS.
This commit is contained in:
parent
88702ff442
commit
24b55bfe11
@ -33,9 +33,19 @@ cmLocalVisualStudioGenerator::~cmLocalVisualStudioGenerator()
|
||||
//----------------------------------------------------------------------------
|
||||
bool cmLocalVisualStudioGenerator::SourceFileCompiles(const cmSourceFile* sf)
|
||||
{
|
||||
return (!sf->GetCustomCommand() &&
|
||||
!sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
|
||||
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"));
|
||||
// Identify the language of the source file.
|
||||
if(const char* lang = this->GetSourceFileLanguage(*sf))
|
||||
{
|
||||
// Check whether this source will actually be compiled.
|
||||
return (!sf->GetCustomCommand() &&
|
||||
!sf->GetPropertyAsBool("HEADER_FILE_ONLY") &&
|
||||
!sf->GetPropertyAsBool("EXTERNAL_OBJECT"));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unknown source file language. Assume it will not be compiled.
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
1
Tests/Complex/Executable/A.txt
Normal file
1
Tests/Complex/Executable/A.txt
Normal file
@ -0,0 +1 @@
|
||||
This file should not be compiled!
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||
|
||||
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||
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)
|
||||
|
1
Tests/ComplexOneConfig/Executable/A.txt
Normal file
1
Tests/ComplexOneConfig/Executable/A.txt
Normal file
@ -0,0 +1 @@
|
||||
This file should not be compiled!
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||
|
||||
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||
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)
|
||||
|
1
Tests/ComplexRelativePaths/Executable/A.txt
Normal file
1
Tests/ComplexRelativePaths/Executable/A.txt
Normal file
@ -0,0 +1 @@
|
||||
This file should not be compiled!
|
@ -19,7 +19,7 @@ ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||
SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared)
|
||||
LINK_LIBRARIES(${COMPLEX_LIBS})
|
||||
|
||||
ADD_EXECUTABLE(A A.cxx A.hh A.h)
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user