Browse Source

Linux: Disabled creating position independent executables for GUI apps

tags/2021-05-28
tpoole 8 years ago
parent
commit
3659742a3a
2 changed files with 25 additions and 11 deletions
  1. +14
    -6
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h
  2. +11
    -5
      extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h

+ 14
- 6
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_CodeBlocks.h View File

@@ -485,17 +485,25 @@ private:
const auto packages = getPackages(); const auto packages = getPackages();
if (config.exporter.isLinux() && packages.size() > 0)
if (config.exporter.isLinux())
{ {
if (target.isDynamicLibrary()) if (target.isDynamicLibrary())
flags.add ("-shared"); flags.add ("-shared");
auto pkgconfigLibs = String ("`pkg-config --libs");
for (auto p : packages)
pkgconfigLibs << " " << p;
if (target.type == ProjectType::Target::StandalonePlugIn
|| target.type == ProjectType::Target::GUIApp)
flags.add ("-no-pie");
if (packages.size() > 0)
{
String pkgconfigLibs ("`pkg-config --libs");
pkgconfigLibs << "`";
flags.add (pkgconfigLibs);
for (auto p : packages)
pkgconfigLibs << " " << p;
pkgconfigLibs << "`";
flags.add (pkgconfigLibs);
}
} }
return getCleanedStringArray (flags); return getCleanedStringArray (flags);


+ 11
- 5
extras/Projucer/Source/ProjectSaving/jucer_ProjectExport_Make.h View File

@@ -113,6 +113,10 @@ public:
if (getTargetFileType() == pluginBundle) if (getTargetFileType() == pluginBundle)
result.add ("-Wl,--no-undefined"); result.add ("-Wl,--no-undefined");
} }
else if (type == GUIApp || type == StandalonePlugIn)
{
result.add ("-no-pie");
}
return result; return result;
} }
@@ -289,7 +293,8 @@ public:
out << "$(JUCE_LDFLAGS) "; out << "$(JUCE_LDFLAGS) ";
if (getTargetFileType() == sharedLibraryOrDLL || getTargetFileType() == pluginBundle)
if (getTargetFileType() == sharedLibraryOrDLL || getTargetFileType() == pluginBundle
|| type == GUIApp || type == StandalonePlugIn)
out << "$(JUCE_LDFLAGS_" << getTargetVarName() << ") "; out << "$(JUCE_LDFLAGS_" << getTargetVarName() << ") ";
out << "$(RESOURCES) $(TARGET_ARCH)" << newLine; out << "$(RESOURCES) $(TARGET_ARCH)" << newLine;
@@ -374,11 +379,12 @@ public:
//============================================================================== //==============================================================================
bool anyTargetIsSharedLibrary() const bool anyTargetIsSharedLibrary() const
{ {
const int n = targets.size();
for (int i = 0; i < n; ++i)
for (auto* target : targets)
{ {
const ProjectType::Target::TargetFileType fileType = targets.getUnchecked (i)->getTargetFileType();
if (fileType == ProjectType::Target::sharedLibraryOrDLL || fileType == ProjectType::Target::pluginBundle)
const ProjectType::Target::TargetFileType fileType = target->getTargetFileType();
if (fileType == ProjectType::Target::sharedLibraryOrDLL
|| fileType == ProjectType::Target::pluginBundle)
return true; return true;
} }


Loading…
Cancel
Save