Merge branch 'ninja-fix-subdir-objlib-languages' into release
This commit is contained in:
commit
8afa15fab1
@ -110,13 +110,26 @@ void cmNinjaNormalTargetGenerator::WriteLanguagesRules()
|
|||||||
<< "\n\n";
|
<< "\n\n";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Write rules for languages compiled in this target.
|
||||||
std::set<std::string> languages;
|
std::set<std::string> languages;
|
||||||
this->GetTarget()->GetLanguages(languages,
|
std::vector<cmSourceFile*> sourceFiles;
|
||||||
|
this->GetTarget()->GetSourceFiles(sourceFiles,
|
||||||
this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
|
this->GetMakefile()->GetSafeDefinition("CMAKE_BUILD_TYPE"));
|
||||||
|
for(std::vector<cmSourceFile*>::const_iterator
|
||||||
|
i = sourceFiles.begin(); i != sourceFiles.end(); ++i)
|
||||||
|
{
|
||||||
|
const std::string& lang = (*i)->GetLanguage();
|
||||||
|
if(!lang.empty())
|
||||||
|
{
|
||||||
|
languages.insert(lang);
|
||||||
|
}
|
||||||
|
}
|
||||||
for(std::set<std::string>::const_iterator l = languages.begin();
|
for(std::set<std::string>::const_iterator l = languages.begin();
|
||||||
l != languages.end();
|
l != languages.end();
|
||||||
++l)
|
++l)
|
||||||
|
{
|
||||||
this->WriteLanguageRules(*l);
|
this->WriteLanguageRules(*l);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
|
const char *cmNinjaNormalTargetGenerator::GetVisibleTypeName() const
|
||||||
|
@ -255,6 +255,7 @@ if(BUILD_TESTING)
|
|||||||
endif()
|
endif()
|
||||||
ADD_TEST_MACRO(COnly COnly)
|
ADD_TEST_MACRO(COnly COnly)
|
||||||
ADD_TEST_MACRO(CxxOnly CxxOnly)
|
ADD_TEST_MACRO(CxxOnly CxxOnly)
|
||||||
|
ADD_TEST_MACRO(CxxSubdirC CxxSubdirC)
|
||||||
ADD_TEST_MACRO(IPO COnly/COnly)
|
ADD_TEST_MACRO(IPO COnly/COnly)
|
||||||
ADD_TEST_MACRO(OutDir runtime/OutDir)
|
ADD_TEST_MACRO(OutDir runtime/OutDir)
|
||||||
ADD_TEST_MACRO(ObjectLibrary UseCshared)
|
ADD_TEST_MACRO(ObjectLibrary UseCshared)
|
||||||
|
4
Tests/CxxSubdirC/CMakeLists.txt
Normal file
4
Tests/CxxSubdirC/CMakeLists.txt
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.0)
|
||||||
|
project(CxxSubdirC CXX)
|
||||||
|
add_subdirectory(Cdir)
|
||||||
|
add_executable(CxxSubdirC main.cxx $<TARGET_OBJECTS:Cobj>)
|
2
Tests/CxxSubdirC/Cdir/CMakeLists.txt
Normal file
2
Tests/CxxSubdirC/Cdir/CMakeLists.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
enable_language(C)
|
||||||
|
add_library(Cobj OBJECT Cobj.c)
|
1
Tests/CxxSubdirC/Cdir/Cobj.c
Normal file
1
Tests/CxxSubdirC/Cdir/Cobj.c
Normal file
@ -0,0 +1 @@
|
|||||||
|
int Cobj(void) { return 0; }
|
2
Tests/CxxSubdirC/main.cxx
Normal file
2
Tests/CxxSubdirC/main.cxx
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
extern "C" int Cobj(void);
|
||||||
|
int main() { return Cobj(); }
|
Loading…
x
Reference in New Issue
Block a user