If you specify header file as source, it should still use C compiler and not CXX. Also fix COnly test so that it make sure that this still works...

This commit is contained in:
Andy Cedilnik 2002-10-06 12:12:59 -04:00
parent 1ba0a05039
commit 9ed93397fb
5 changed files with 10 additions and 2 deletions

View File

@ -206,7 +206,8 @@ bool cmTarget::HasCxx() const
for(std::vector<cmSourceFile*>::const_iterator i = m_SourceFiles.begin();
i != m_SourceFiles.end(); ++i)
{
if((*i)->GetSourceExtension() != "c")
if((*i)->GetSourceExtension() != "c" &&
(*i)->GetSourceExtension() != "h")
{
return true;
}

View File

@ -1,3 +1,3 @@
# a simple C only test case
PROJECT (conly C)
ADD_EXECUTABLE (conly conly.c)
ADD_EXECUTABLE (conly conly.c foo.c foo.h)

View File

@ -1,4 +1,9 @@
#include "foo.h"
#include <stdio.h>
int main ()
{
printf("Foo: %s\n", foo);
return 0;
}

1
Tests/COnly/foo.c Normal file
View File

@ -0,0 +1 @@
const char* foo = "Foo";

1
Tests/COnly/foo.h Normal file
View File

@ -0,0 +1 @@
extern const char* foo;