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:
parent
1ba0a05039
commit
9ed93397fb
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
#include "foo.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int main ()
|
||||
{
|
||||
printf("Foo: %s\n", foo);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
const char* foo = "Foo";
|
|
@ -0,0 +1 @@
|
|||
extern const char* foo;
|
Loading…
Reference in New Issue