mirror of
https://github.com/reactos/CMake.git
synced 2024-11-28 05:50:42 +00:00
Generators: don't append sources from utility targets to objectSources
This commit is contained in:
parent
38fc334fd0
commit
f037b9b726
@ -114,7 +114,10 @@ std::vector<cmSourceFile*> const& cmGeneratorTarget::GetSourceFiles()
|
||||
void cmGeneratorTarget::ClassifySources()
|
||||
{
|
||||
cmsys::RegularExpression header(CM_HEADER_REGEX);
|
||||
bool isObjLib = this->Target->GetType() == cmTarget::OBJECT_LIBRARY;
|
||||
|
||||
cmTarget::TargetType targetType = this->Target->GetType();
|
||||
bool isObjLib = targetType == cmTarget::OBJECT_LIBRARY;
|
||||
|
||||
std::vector<cmSourceFile*> badObjLib;
|
||||
std::vector<cmSourceFile*> const& sources = this->Target->GetSourceFiles();
|
||||
for(std::vector<cmSourceFile*>::const_iterator si = sources.begin();
|
||||
@ -126,6 +129,10 @@ void cmGeneratorTarget::ClassifySources()
|
||||
{
|
||||
this->CustomCommands.push_back(sf);
|
||||
}
|
||||
else if(targetType == cmTarget::UTILITY)
|
||||
{
|
||||
this->ExtraSources.push_back(sf);
|
||||
}
|
||||
else if(sf->GetPropertyAsBool("HEADER_FILE_ONLY"))
|
||||
{
|
||||
this->HeaderSources.push_back(sf);
|
||||
|
@ -449,3 +449,10 @@ set_property(SOURCE perconfig.out PROPERTY SYMBOLIC 1)
|
||||
add_custom_target(perconfig_target ALL
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$<TARGET_FILE:perconfig>" "config=$<CONFIGURATION>"
|
||||
DEPENDS perconfig.out)
|
||||
|
||||
# Test SOURCES in add_custom_target() with COMPILE_DEFINITIONS
|
||||
# which previously caused a crash in the makefile generators.
|
||||
add_custom_target(source_in_custom_target SOURCES source_in_custom_target.cpp)
|
||||
set_property(SOURCE source_in_custom_target
|
||||
PROPERTY COMPILE_DEFINITIONS "TEST"
|
||||
)
|
||||
|
0
Tests/CustomCommand/source_in_custom_target.cpp
Normal file
0
Tests/CustomCommand/source_in_custom_target.cpp
Normal file
Loading…
Reference in New Issue
Block a user