Merge branch 'fix-genex-HEAD-target' into release

This commit is contained in:
Brad King 2013-06-05 09:44:52 -04:00
commit 14779f87d2
3 changed files with 20 additions and 4 deletions

View File

@ -315,6 +315,7 @@ static const char* targetPropertyTransitiveWhitelist[] = {
std::string getLinkedTargetsContent(const std::vector<std::string> &libraries, std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
cmTarget *target, cmTarget *target,
cmTarget *headTarget,
cmGeneratorExpressionContext *context, cmGeneratorExpressionContext *context,
cmGeneratorExpressionDAGChecker *dagChecker, cmGeneratorExpressionDAGChecker *dagChecker,
const std::string &interfacePropertyName) const std::string &interfacePropertyName)
@ -345,7 +346,7 @@ std::string getLinkedTargetsContent(const std::vector<std::string> &libraries,
std::string linkedTargetsContent = cge->Evaluate(context->Makefile, std::string linkedTargetsContent = cge->Evaluate(context->Makefile,
context->Config, context->Config,
context->Quiet, context->Quiet,
context->HeadTarget, headTarget,
target, target,
dagChecker); dagChecker);
if (cge->GetHadContextSensitiveCondition()) if (cge->GetHadContextSensitiveCondition())
@ -538,6 +539,8 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS"; interfacePropertyName = "INTERFACE_COMPILE_DEFINITIONS";
} }
cmTarget *headTarget = context->HeadTarget ? context->HeadTarget : target;
const char **transBegin = targetPropertyTransitiveWhitelist; const char **transBegin = targetPropertyTransitiveWhitelist;
const char **transEnd = targetPropertyTransitiveWhitelist const char **transEnd = targetPropertyTransitiveWhitelist
+ (sizeof(targetPropertyTransitiveWhitelist) / + (sizeof(targetPropertyTransitiveWhitelist) /
@ -547,11 +550,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{ {
const cmTarget::LinkInterface *iface = target->GetLinkInterface( const cmTarget::LinkInterface *iface = target->GetLinkInterface(
context->Config, context->Config,
context->HeadTarget); headTarget);
if(iface) if(iface)
{ {
linkedTargetsContent = linkedTargetsContent =
getLinkedTargetsContent(iface->Libraries, target, getLinkedTargetsContent(iface->Libraries, target,
headTarget,
context, &dagChecker, context, &dagChecker,
interfacePropertyName); interfacePropertyName);
} }
@ -561,11 +565,12 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
{ {
const cmTarget::LinkImplementation *impl = target->GetLinkImplementation( const cmTarget::LinkImplementation *impl = target->GetLinkImplementation(
context->Config, context->Config,
context->HeadTarget); headTarget);
if(impl) if(impl)
{ {
linkedTargetsContent = linkedTargetsContent =
getLinkedTargetsContent(impl->Libraries, target, getLinkedTargetsContent(impl->Libraries, target,
headTarget,
context, &dagChecker, context, &dagChecker,
interfacePropertyName); interfacePropertyName);
} }
@ -614,7 +619,7 @@ static const struct TargetPropertyNode : public cmGeneratorExpressionNode
std::string result = cge->Evaluate(context->Makefile, std::string result = cge->Evaluate(context->Makefile,
context->Config, context->Config,
context->Quiet, context->Quiet,
context->HeadTarget, headTarget,
target, target,
&dagChecker); &dagChecker);

View File

@ -109,6 +109,11 @@ set_property(TARGET libbad APPEND PROPERTY
INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bad" INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bad"
) )
add_library(lib6 SHARED other.cpp)
add_library(lib7 SHARED other.cpp)
target_link_libraries(lib7 $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:lib6>)
target_include_directories(lib7 PUBLIC $<$<STREQUAL:$<TARGET_PROPERTY:TYPE>,EXECUTABLE>:/lib7/include>)
add_custom_target(head_target_test "some_bogus_custom_tool \"$<TARGET_PROPERTY:lib7,INCLUDE_DIRECTORIES>$<TARGET_PROPERTY:lib7,INTERFACE_INCLUDE_DIRECTORIES>\"")
add_library(includes_source_good empty.cpp) add_library(includes_source_good empty.cpp)
target_include_directories(includes_source_good target_include_directories(includes_source_good

View File

@ -0,0 +1,6 @@
#ifdef _WIN32
__declspec(dllexport)
#endif
int other() {
return 0;
}