BUG: Only pay attention to the FRAMEWORK target property for SHARED library targets
This commit is contained in:
parent
a0533be267
commit
ee91e25499
@ -727,7 +727,8 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
|
|||||||
buildFiles->AddObject(xsf);
|
buildFiles->AddObject(xsf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(cmtarget.GetPropertyAsBool("FRAMEWORK"))
|
if (cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
cmtarget.GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
this->AddFrameworkPhases(&cmtarget, buildPhases);
|
this->AddFrameworkPhases(&cmtarget, buildPhases);
|
||||||
}
|
}
|
||||||
@ -1239,7 +1240,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||||||
target.GetType() == cmTarget::EXECUTABLE)
|
target.GetType() == cmTarget::EXECUTABLE)
|
||||||
{
|
{
|
||||||
std::string pndir = target.GetDirectory();
|
std::string pndir = target.GetDirectory();
|
||||||
if(target.GetPropertyAsBool("FRAMEWORK"))
|
if (target.GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
target.GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
pndir += "/..";
|
pndir += "/..";
|
||||||
pndir = cmSystemTools::CollapseFullPath(pndir.c_str());
|
pndir = cmSystemTools::CollapseFullPath(pndir.c_str());
|
||||||
@ -2053,7 +2055,8 @@ void cmGlobalXCodeGenerator::CreateGroups(cmLocalGenerator* root,
|
|||||||
}
|
}
|
||||||
std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
|
std::vector<cmSourceFile*> classes = cmtarget.GetSourceFiles();
|
||||||
// add framework copy headers
|
// add framework copy headers
|
||||||
if(cmtarget.GetPropertyAsBool("FRAMEWORK"))
|
if (cmtarget.GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
cmtarget.GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
const char* headers = cmtarget.GetProperty("FRAMEWORK_PUBLIC_HEADERS");
|
const char* headers = cmtarget.GetProperty("FRAMEWORK_PUBLIC_HEADERS");
|
||||||
if(!headers)
|
if(!headers)
|
||||||
|
@ -1775,7 +1775,8 @@ void cmLocalGenerator
|
|||||||
// do not add the target full name but just use the directory
|
// do not add the target full name but just use the directory
|
||||||
// name
|
// name
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if(!tgt->GetPropertyAsBool("FRAMEWORK"))
|
if (!(tgt->GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
tgt->GetPropertyAsBool("FRAMEWORK")))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
linkItem += "/";
|
linkItem += "/";
|
||||||
|
@ -112,7 +112,7 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
|
|||||||
void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
|
void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if(this->Target->GetPropertyAsBool("FRAMEWORK"))
|
if (this->Target->GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
this->WriteFrameworkRules(relink);
|
this->WriteFrameworkRules(relink);
|
||||||
return;
|
return;
|
||||||
@ -505,7 +505,8 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
|
|||||||
}
|
}
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// If we're creating a framework, place the output into a framework directory
|
// If we're creating a framework, place the output into a framework directory
|
||||||
if(this->Target->GetPropertyAsBool("FRAMEWORK"))
|
if (this->Target->GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
this->Target->GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
this->CreateFramework(targetName, outpath);
|
this->CreateFramework(targetName, outpath);
|
||||||
}
|
}
|
||||||
|
@ -1790,7 +1790,8 @@ void cmTarget::NormalGetFullNameInternal(TargetType type,
|
|||||||
}
|
}
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// frameworks do not have a prefix or a suffix
|
// frameworks do not have a prefix or a suffix
|
||||||
if(this->GetPropertyAsBool("FRAMEWORK"))
|
if (this->GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
this->GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
targetPrefix = 0;
|
targetPrefix = 0;
|
||||||
targetSuffix = 0;
|
targetSuffix = 0;
|
||||||
@ -2322,7 +2323,8 @@ const char* cmTarget::GetOutputDir(bool implib)
|
|||||||
|
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
// frameworks do not have a prefix or a suffix
|
// frameworks do not have a prefix or a suffix
|
||||||
if(this->GetPropertyAsBool("FRAMEWORK"))
|
if (this->GetType() == cmTarget::SHARED_LIBRARY &&
|
||||||
|
this->GetPropertyAsBool("FRAMEWORK"))
|
||||||
{
|
{
|
||||||
out += "/";
|
out += "/";
|
||||||
out += this->GetFullName(0, implib);
|
out += this->GetFullName(0, implib);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
project(Framework)
|
project(Framework)
|
||||||
add_library(foo SHARED foo.cxx foo.h )
|
|
||||||
|
add_library(foo SHARED foo.cxx foo.h)
|
||||||
set_target_properties(foo PROPERTIES
|
set_target_properties(foo PROPERTIES
|
||||||
FRAMEWORK TRUE
|
FRAMEWORK TRUE
|
||||||
FRAMEWORK_PUBLIC_HEADERS "foo.h;foo2.h"
|
FRAMEWORK_PUBLIC_HEADERS "foo.h;foo2.h"
|
||||||
@ -9,3 +10,18 @@ set_target_properties(foo PROPERTIES
|
|||||||
add_executable(bar bar.cxx)
|
add_executable(bar bar.cxx)
|
||||||
target_link_libraries(bar foo)
|
target_link_libraries(bar foo)
|
||||||
|
|
||||||
|
|
||||||
|
# Make a static library and apply the framework properties to it to verify
|
||||||
|
# that everything still builds correctly, but it will not actually produce
|
||||||
|
# a framework... The framework properties only apply when the library type
|
||||||
|
# is SHARED.
|
||||||
|
#
|
||||||
|
add_library(fooStatic STATIC foo.cxx foo.h)
|
||||||
|
set_target_properties(fooStatic PROPERTIES
|
||||||
|
FRAMEWORK TRUE
|
||||||
|
FRAMEWORK_PUBLIC_HEADERS "foo.h;foo2.h"
|
||||||
|
FRAMEWORK_VERSION ver2
|
||||||
|
FRAMEWORK_RESOURCES "test.lua"
|
||||||
|
)
|
||||||
|
add_executable(barStatic bar.cxx)
|
||||||
|
target_link_libraries(barStatic fooStatic)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user